OSOperating Systems · Lesson 1 of 7

What an OS Actually Does

Strip away the desktop and wallpaper: an operating system is a resource manager and a bodyguard. It multiplexes one CPU among hundreds of programs, and stops each one from wrecking the others.

Three jobs. Abstraction: turn ugly hardware (disk sectors, network chips, interrupts) into clean concepts (files, sockets, processes). Multiplexing: share limited CPU, RAM, and disk among many programs that each think they own the machine. Protection: isolate programs from each other and the kernel from everyone, so a crashing game can't take down your unsaved document.

Text
The layer cake:

  your app (Chrome, your Python script)
  ------------------------------------ user space
  standard library (libc, CPython, JVM)
  ==================================== system call boundary
  kernel: scheduler | memory | filesystems | drivers | network
  ------------------------------------
  hardware: CPU, RAM, SSD, NIC, GPU

Everything above the ==== line can crash safely.
Everything below it runs with total power.

The CPU itself enforces the boundary with privilege modes: kernel code runs in a privileged mode that can touch any memory and any device; your programs run in user mode, where dangerous instructions and other programs' memory are off-limits. Crossing the line happens only through system calls — the kernel's official API.

◆ Note
Kernel panics (Linux) and Blue Screens (Windows) are what happens when code below the line hits a bug — there's no safety net beneath the kernel, so the OS stops everything rather than corrupt your data. A user program crashing is Tuesday; a kernel crash is an event.