Operating Systems

What actually happens between my program and the hardware? Processes, threads, the scheduler, system calls, virtual memory, files, descriptors, I/O, synchronization, IPC, sockets and containers — taught by following one program from `./server` down to CPU, RAM, disk and NIC, with simulators you can break.

Your path through Operating Systems

0 of 19 Foundation lessons done
0 of 72 lessons done overall
Start: What an Operating System Is For →

Then follow the stages in order

Each stage builds on the ones before it. Labs and simulators sit right after the lessons they exercise. Open a stage to see its lessons. Full roadmap with goals →

  1. Programs0 of 4 lessons done
    1. What an Operating System Is ForFoundation≈ 10 min
    2. Follow a Program: from `./server` to the First InstructionFoundation≈ 15 min
    3. Program versus ProcessFoundation≈ 10 min
    4. The Process Memory LayoutFoundation≈ 10 min
  2. Processes0 of 3 lessons done
    1. The Anatomy of a ProcessFoundation≈ 10 min
    2. Process StatesFoundation≈ 10 min
    3. Creating Processes: fork, exec, waitFoundation≈ 10 min
  3. Threads0 of 7 lessons done
    1. Threads: Several Instruction Streams in One ProcessFoundation≈ 10 min
    2. Process versus ThreadFoundation≈ 10 min
    3. Concurrency versus ParallelismFoundation≈ 10 min
    4. Threads versus Async versus ProcessesFoundation≈ 5 min
    5. How C++, JavaScript and Python Map onto the OSFoundation≈ 10 min
    6. The Event LoopFoundation≈ 10 min
    7. Async I/O: What `await readFile()` Actually DoesFoundation≈ 10 min
  4. Scheduling0 of 3 lessons done
    1. The Scheduling ProblemFoundation≈ 10 min
    2. Scheduling Simulator: FCFS, Round Robin, PriorityFoundation≈ 10 min
    3. Context SwitchingFoundation≈ 10 min
  5. System Calls0 of 2 lessons done
    1. System CallsFoundation≈ 15 min
    2. User Mode vs Kernel ModeFoundation≈ 10 min
  6. Files / Descriptors0 of 4 lessons done
    1. Files, Paths and NamesIntermediate≈ 10 min
    2. File DescriptorsIntermediate≈ 15 min
    3. File Systems: From Path to BlocksIntermediate≈ 15 min
    4. InodesIntermediate≈ 10 min
  7. Virtual Memory0 of 6 lessons done
    1. Stack vs HeapIntermediate≈ 10 min
    2. Stack FramesIntermediate≈ 10 min
    3. Stack OverflowIntermediate≈ 10 min
    4. What Happens When I Allocate Memory?Intermediate≈ 15 min
    5. Why Virtual Memory?Intermediate≈ 10 min
    6. The Virtual Address SpaceIntermediate≈ 10 min
  8. Paging0 of 7 lessons done
    1. PagingIntermediate≈ 10 min
    2. Page TablesIntermediate≈ 10 min
    3. The TLBIntermediate≈ 10 min
    4. Page FaultsIntermediate≈ 10 min
    5. Memory Pressure, Swap and the OOM KillerIntermediate≈ 15 min
    6. Memory MappingIntermediate≈ 10 min
    7. Copy-on-WriteIntermediate≈ 10 min
  9. I/O0 of 4 lessons done
    1. Follow a File ReadIntermediate≈ 15 min
    2. Blocking, Non-blocking, Multiplexed, AsynchronousIntermediate≈ 10 min
    3. I/O Multiplexing: select, poll, epoll, kqueue, IOCPIntermediate≈ 15 min
    4. Everything Is I/OIntermediate≈ 15 min
  10. Concurrency0 of 3 lessons done
    1. A Taxonomy of Concurrency BugsIntermediate≈ 15 min
    2. Race ConditionsIntermediate≈ 15 min
    3. Critical SectionsIntermediate≈ 10 min
  11. Synchronization0 of 4 lessons done
    1. MutexesAdvanced≈ 10 min
    2. Semaphores and Condition VariablesAdvanced≈ 10 min
    3. Atomic OperationsAdvanced≈ 10 min
    4. DeadlocksAdvanced≈ 10 min
  12. IPC0 of 4 lessons done
    1. IPC: Deliberate Holes in Process IsolationAdvanced≈ 10 min
    2. Pipes: A Kernel Buffer Between Two ProcessesAdvanced≈ 10 min
    3. Shared Memory: Zero Copies, Zero ProtectionAdvanced≈ 10 min
    4. Signals: Asynchronous Notifications From the KernelAdvanced≈ 15 min
  13. Sockets0 of 1 lessons done
    1. The Socket: A Descriptor With Two Kernel Buffers Behind ItAdvanced≈ 15 min
  14. Containers0 of 3 lessons done
    1. Containers Are Processes With the Kernel’s View NarrowedAdvanced≈ 15 min
    2. Process Isolation: One Kernel, Many PID 1sAdvanced≈ 10 min
    3. VM vs Container: Where the Boundary IsAdvanced≈ 10 min
  15. Performance / Debugging0 of 17 lessons done
    1. The OS Simulator: Cores, Processes, RAM, I/O and LocksAdvanced≈ 10 min
    2. Break the OS: Predict, Break, DiagnoseAdvanced≈ 10 min
    3. The OS Debugging Playbook: Four Symptoms, Fourteen CausesAdvanced≈ 15 min
    4. Capstone: A Server With 50,000 Concurrent ConnectionsAdvanced≈ 15 min
    5. Follow send() Through the OS to recv()Advanced≈ 15 min
    6. Build a Tiny Server: V0 to V5Advanced≈ 10 min
    7. C10K: Ten Thousand Connections, Then a MillionAdvanced≈ 15 min
    8. Combined Failure Simulator: Break a Layer, Watch It PropagateAdvanced≈ 15 min
    9. Capstone: Three Seconds from WarsawAdvanced≈ 15 min
    10. The Blocking ServerAdvanced≈ 5 min
    11. Thread per ConnectionAdvanced≈ 10 min
    12. The Thread Pool ServerAdvanced≈ 10 min
    13. The Event-Driven ServerAdvanced≈ 10 min
    14. The Buffer ChainAdvanced≈ 10 min
    15. What Happens When the Receiver Is SlowAdvanced≈ 10 min
    16. Zero-Copy: Serving a File Without Touching ItAdvanced≈ 15 min
    17. Memory Mapping, the Page Cache and Network I/OAdvanced≈ 10 min

Follow one operation through every layer

The defining experience: no “Client → Server” and stop. Every arrow can be expanded until you reach the hardware.

  1. C++ / Python / JavaScript program→
  2. Runtime→
  3. System call→
  4. Kernel→
  5. Scheduler→
  6. Virtual memory→
  7. CPU / RAM / Disk / Network
Learn → Visualize → Inspect → Simulate
Every mechanism is derived from the constraint it solves, then shown as a stepped simulation you can run, pause, step and reset.
Break → Debug → Practice → Interview
Labs let you exhaust memory, deadlock threads, drop packets and expire certificates; challenges make you find the root cause across layers.
Accuracy over slogans
Sections are labelled CONCEPTUAL · LINUX · UNIX-STYLE · WINDOWS · IPV4 · IPV6 · SIMULATED · RUNTIME-SPECIFIC so you always know whether you are reading a model or an implementation.

Start here

Journeys

“What actually happens when I…?” — zoom from four boxes to the full internals.

Modules

0/72 lessons mastered
How Programs Run0/4
What an OS is for, and what happens between `./server` and the first instruction on a CPU: loader, address space, process, scheduler.
Several programs want the same CPU, memory, disk and NIC. Who coordinates them?
Processes0/3
A process is a running program with an identity, an address space, a state, open resources and a parent. The process table, the state machine, fork and exec.
How does one executable become three isolated running instances?
Threads, Async & Event Loops0/7
Threads inside a process, concurrency vs parallelism, threads vs async vs processes, and how C++, JavaScript/TypeScript and Python each map onto the OS.
Why can a single core run a thousand tasks "at once", and why is that not parallelism?
CPU Scheduling0/3
A hundred runnable processes, eight cores. Ready queues, time slices, priority, preemption, fairness, and what a context switch actually saves and restores.
There are 100 runnable processes and 8 cores. Who runs, and for how long?
System Calls & Kernel Mode0/2
Why applications cannot touch hardware directly, the user/kernel boundary, and what a system call costs.
Why can’t my program just write to the disk itself?
Stack & Heap0/4
The process memory layout, stack frames pushed and popped by function calls, the heap under `new`/`malloc`/object allocation, and what a stack overflow really is.
Where does a local variable live, where does an object live, and why does recursion have a limit?
Virtual Memory & Paging0/9
Every process believes it owns a huge private memory. Pages, frames, page tables, the TLB, page faults, memory pressure, memory mapping and copy-on-write.
Multiple processes each believe they have their own large continuous memory. How?
Files, File Systems & Descriptors0/4
Paths, files, directories, metadata, permissions, offsets; the descriptor table; how a path becomes blocks on storage; inodes on Unix-style systems.
What is the difference between a filename and a file — and what is FD 3?
I/O0/4
Follow a `read()` from the call to the SSD and back; blocking, non-blocking, asynchronous and multiplexed I/O; and why a file and a socket are the same kind of thing.
How can one thread wait for 10,000 sockets without spinning?
Concurrency, Synchronization & Deadlocks0/7
Race conditions, lost updates, visibility, critical sections, mutexes, semaphores, atomics, and the four ingredients of a deadlock.
Two threads both add one to a counter and the result is one. Why?
Inter-Process Communication0/4
Pipes, shared memory, message queues, signals and sockets — compared on speed, isolation, complexity and local-vs-remote.
Two isolated processes need to talk. What are the options and what does each cost?
Sockets0/1
The socket abstraction as the OS sees it: a descriptor with buffers behind it, and the bridge into the Networking domain.
What does the kernel actually give me when I call `socket()`?
Containers & the OS0/3
Containers are not small virtual machines: namespaces, control groups, layered filesystems, shared host kernel, and how that differs from a hypervisor.
If a container has no kernel of its own, what is actually isolating it?
OS Internals Lab0/2
A configurable OS simulator — cores, processes, threads, RAM, I/O, locks — and a panel of buttons to break it, then diagnose the failure.
What happens to the scheduler, memory and I/O when I exhaust something?
OS Debugging & Capstone0/2
High CPU, high memory, hangs, too many open files: the diagnosis playbook, and the capstone — explain a 50,000-connection server layer by layer, then diagnose what was injected.
The process is at 100% CPU. What are the four different things that could mean?
OS + Networking Together0/13
Follow `send()` through the socket API, the kernel, the transport stack and the NIC to a server that wakes up in `recv()`; build a tiny server from blocking to event-driven; buffers, backpressure, zero-copy and a combined failure simulator.
What actually happens between writing `send()` and another machine’s process waking up?

Connected to the other domains

These domains are one map, not isolated courses.