Operating systems
A university first course in operating systems: the kernel boundary and system calls, processes and threads, CPU scheduling, locks and synchronisation, deadlock, memory management, file systems, I/O and drivers, and virtualisation and isolation. Every lesson is an animated machine you can step through, then a short quiz, with Python simulations where they help.
The kernel and system calls
What the kernel is and how programs ask it for help. Start with the Software lesson on what an operating system does and the Hardware lesson on interrupts and I/O. The Linux lesson on how Linux boots covers the boot order; here we look at what the kernel builds before the first process starts.
-
Lesson 01 · 12 min
User mode and kernel mode
11 stepsNot started -
Lesson 02 · 12 min
System calls: crossing into the kernel
12 stepsNot started -
Lesson 03 · 13 min
Traps, exceptions and the interrupt table
11 stepsNot started -
Lesson 04 · 12 min
Monolithic kernels and microkernels
11 stepsNot started -
Lesson 05 · 12 min
What the kernel sets up before the first process
11 stepsNot started
Processes and threads
How the kernel creates, tracks and switches between running programs. The Linux lesson on processes and signals shows the commands; this module shows what happens inside.
-
Lesson 06 · 12 min
The process: address space, registers and the PCB
10 stepsNot started -
Lesson 07 · 12 min
Process states: ready, running and blocked
10 stepsNot started -
Lesson 08 · 14 min
fork, exec and wait from the kernel's side
11 stepsNot started -
Lesson 09 · 12 min
The context switch and the timer interrupt
11 stepsNot started -
Lesson 10 · 12 min
Threads from the kernel's side
10 stepsNot started -
Lesson 11 · 13 min
Pipes, shared memory and message passing
11 stepsNot started
CPU scheduling
Who runs next, and for how long. Builds on the context switch from the processes module; the Hardware lesson on multicore processors explains why cache affinity matters. The Embedded course later applies these ideas to RTOS tasks; this module is the general theory.
-
Lesson 12 · 14 min
Turnaround, response time and fairness
10 stepsNot started -
Lesson 13 · 14 min
First come first served and shortest job first
10 stepsNot started -
Lesson 14 · 14 min
Round robin and the time slice
11 stepsNot started -
Lesson 15 · 14 min
The multi-level feedback queue
10 stepsNot started -
Lesson 16 · 14 min
Fair-share scheduling and Linux CFS
9 stepsNot started -
Lesson 17 · 14 min
Scheduling on many cores
11 stepsNot started
Synchronisation
Keeping shared data correct when threads run at once. The Software lesson on threads and concurrency shows the race and a simple lock; this module builds the tools underneath and the theory behind them. The Embedded course uses mutexes and semaphores on a microcontroller.
-
Lesson 18 · 14 min
The critical-section problem and Peterson's algorithm
12 stepsNot started -
Lesson 19 · 14 min
Locks, spinlocks and atomic instructions
11 stepsNot started -
Lesson 20 · 14 min
Condition variables
12 stepsNot started -
Lesson 21 · 14 min
Semaphores
9 stepsNot started -
Lesson 22 · 12 min
Monitors
12 stepsNot started -
Lesson 23 · 16 min
Producer-consumer, readers-writers and dining philosophers
11 stepsNot started
Deadlock
When threads wait for each other forever, and how to prevent, avoid or recover from it. Builds on locks from the synchronisation module.
-
Lesson 24 · 12 min
The four conditions for deadlock
10 stepsNot started -
Lesson 25 · 12 min
Resource allocation graphs
10 stepsNot started -
Lesson 26 · 14 min
Preventing deadlock with lock ordering
12 stepsNot started -
Lesson 27 · 14 min
Avoiding deadlock: the banker's algorithm
11 stepsNot started -
Lesson 28 · 14 min
Detecting and recovering from deadlock
11 stepsNot started
Memory management
How the kernel gives every process its own memory. The Hardware lessons on the memory hierarchy, caches and virtual memory explain address translation, the TLB and page faults in the chip; this module covers what the kernel does with them.
-
Lesson 29 · 14 min
Address spaces, base and bounds
10 stepsNot started -
Lesson 30 · 14 min
Segmentation and free-space management
11 stepsNot started -
Lesson 31 · 14 min
The kernel's page tables: entry bits, building and switching tables
10 stepsNot started -
Lesson 32 · 14 min
Managing the TLB: misses, flushes, ASIDs and shootdowns
11 stepsNot started -
Lesson 33 · 14 min
Multi-level page tables
11 stepsNot started -
Lesson 34 · 14 min
Page faults and swapping to disk
10 stepsNot started -
Lesson 35 · 14 min
Page replacement: FIFO, LRU and clock
11 stepsNot started
Memory in practice
What happens when memory runs short, and the tricks real kernels use to share it.
File systems
How files and folders are laid out on a disk and kept safe through crashes. The Linux lessons on the file system and disks show the user's view. Journaling uses the same write-ahead idea as the Databases lesson on write-ahead logging and recovery.
-
Lesson 40 · 14 min
Files, directories and file descriptors
10 stepsNot started -
Lesson 41 · 15 min
Inodes and data blocks
11 stepsNot started -
Lesson 42 · 14 min
FAT and ext4: two on-disk layouts
11 stepsNot started -
Lesson 43 · 14 min
The buffer cache and writing back
10 stepsNot started -
Lesson 44 · 14 min
Memory-mapped files
11 stepsNot started -
Lesson 45 · 15 min
RAID: spreading data across many disks
12 stepsNot started -
Lesson 46 · 14 min
Crash consistency and journaling
10 stepsNot started -
Lesson 47 · 14 min
File systems on SSDs
10 stepsNot started
I/O, virtualisation and isolation
Talking to devices, running whole machines inside machines, and keeping programs apart. Start from the Hardware lesson on interrupts and I/O for polling, interrupts and DMA. For containers, the Software lesson on containers and deployment compares them with virtual machines, and the Linux lesson on namespaces and cgroups shows how they are built.
-
Lesson 48 · 14 min
Device drivers and the I/O stack
12 stepsNot started -
Lesson 49 · 14 min
Interrupt handlers: top halves, bottom halves and deferred work
11 stepsNot started -
Lesson 50 · 14 min
Disk scheduling
8 stepsNot started -
Lesson 51 · 15 min
Hypervisors and virtual machines
11 stepsNot started -
Lesson 52 · 15 min
Hardware support for virtualisation: VT-x and nested page tables
12 stepsNot started -
Lesson 53 · 14 min
Protection, privilege and sandboxing
10 stepsNot started
Special topics
Stand-alone deep dives. Take them any time after the module they build on.
-
Lesson S1 · 15 min
Real-time scheduling and priority inversion
Builds on CPU scheduling
11 stepsNot started -
Lesson S2 · 14 min
Concurrency bugs and event-based concurrency
Builds on Deadlock
11 stepsNot started -
Lesson S3 · 14 min
Lock-free data structures
Builds on Synchronisation
11 stepsNot started -
Lesson S4 · 14 min
Network and distributed file systems
Builds on File systems
11 stepsNot started -
Lesson S5 · 14 min
How kernel attacks work and how kernels defend
Builds on I/O, virtualisation and isolation
10 stepsNot started