What is an operating system, why does it exist, and what does the kernel actually do? The illusion of private machines, system calls, and what this book covers.
OS Fundamentals
Understand operating systems from first principles. Processes, memory management, scheduling, filesystems, and concurrency — and why your algorithms and data structures knowledge actually matters here. Hands-on with real Linux tools.
what you'll learn
- Processes and execution — fork, exec, process states, and what the kernel manages
- CPU scheduling — round-robin, CFS, priority inversion, and real-time scheduling
- Virtual memory — page tables, TLB, demand paging, and why mmap works
- Filesystems — inodes, directories, journaling, and how ext4 organizes disk
- Concurrency — threads, mutexes, semaphores, deadlocks, and race conditions
- Hands-on Linux tools — /proc, strace, top, and observing the OS in action
Processes & Execution
The fundamental abstraction that lets multiple programs share one CPU. Understand process memory layout, the illusion of isolation, and why a 'running program' is more complex than it sounds.
fork(), exec(), and Process Creation
How processes are born. The elegant Unix model of fork-then-exec, copy-on-write optimization, and why creating a process is actually duplicating one.
Running, sleeping, zombie, orphan—processes have a lifecycle. Understand state transitions, what the scheduler sees, and how to diagnose stuck processes.
Shared memory vs isolation. When to use threads, when to use processes, and how Linux blurs the line with clone(). The data structures that track both.
Signals & Inter-Process Communication
How processes talk to each other and respond to events. Signals, pipes, and the foundations of IPC. Why SIGKILL can't be caught and SIGTERM can.
CPU Scheduling
One CPU, many processes. The scheduler decides who runs, for how long, and in what order. Understand why this is fundamentally a data structures problem.
FCFS, Round Robin, Priority Queues, MLFQ. Classic algorithms and their trade-offs. Why O(1) scheduling was revolutionary and why CFS replaced it.
Linux's Completely Fair Scheduler
CFS in depth: red-black trees for O(log n) scheduling, virtual runtime, and how Linux achieves fairness. See the data structure that runs your computer.
Priority, Nice Values & Real-Time Scheduling
Not all processes are equal. How to influence scheduling with nice, renice, and real-time priorities. When your process absolutely must run on time.
The mechanics of switching between processes. What gets saved, what gets restored, and why context switches are expensive. Measuring switch overhead.
Memory Management
Every process thinks it has the entire address space to itself. How the OS creates this illusion, why it matters, and what happens when you dereference a pointer.
Page Tables & Address Translation
The data structure that maps virtual to physical addresses. Multi-level page tables, why they're trees, and the space-time trade-off they embody.
TLB: The Translation Lookaside Buffer
Page table lookups are slow. The TLB caches translations for speed. Understand TLB misses, flushes, and why huge pages exist.
Memory isn't allocated until it's used. Page faults, lazy allocation, and how the OS handles 'missing' pages. The performance implications of page fault storms.
When RAM is full, something must go. LRU, Clock, and the algorithms that decide which pages get evicted. Why optimal replacement is impossible in practice.
Memory Allocators: Inside malloc()
What happens when you malloc(100)? Free lists, buddy allocators, slab allocation. The data structures that make dynamic memory possible.
Concurrency & Synchronization
When multiple threads access shared data, order matters. Race conditions, data races, and why concurrent programming is fundamentally hard.
Mutual exclusion: ensuring only one thread accesses shared data at a time. How mutexes work, the cost of locking, and when to use them.
Semaphores & Condition Variables
Beyond mutexes: coordinating thread execution order. Counting semaphores, condition variables, and the producer-consumer pattern.
Deadlock: Detection, Prevention & Avoidance
When threads wait for each other forever. The four conditions for deadlock, how to prevent it, and why databases use deadlock detection.
Concurrency without locks. Compare-and-swap, atomic operations, and the data structures that power high-performance concurrent systems.
File Systems
Everything is a file—but what is a file? File descriptors, the file table, and the abstraction that unifies devices, sockets, and storage.
How files are stored on disk. Inodes, directory entries, hard links vs soft links. The tree structure that organizes your filesystem.
Filesystem Implementation: ext4
How ext4 organizes data on disk. Block groups, bitmaps, extents, and the B-tree that makes directory lookup fast.
What happens when power fails mid-write? Journaling filesystems, write-ahead logging, and how databases and filesystems stay consistent.
How Linux supports dozens of filesystems with one interface. The VFS abstraction layer, inode caching, and dentry caches.
I/O & Storage
How the OS talks to storage hardware. Block devices, device drivers, and the interface between kernel and hardware.
Ordering disk requests for performance. Elevator algorithms, CFQ, deadline scheduler, and why SSDs changed everything.
The page cache, buffer cache, and why your writes don't hit disk immediately. Understanding sync, fsync, and durability guarantees.
SSD vs HDD: Performance Characteristics
Flash storage changes everything. Random access, wear leveling, TRIM, and why SSD-era code looks different from spinning-disk-era code.
Virtualization & Containers
Running an OS inside an OS. Hypervisors, hardware virtualization, and the illusion of having your own machine.
Isolation without virtualization. PID namespaces, mount namespaces, network namespaces—the building blocks of containers.
Resource limits for processes. CPU limits, memory limits, I/O bandwidth—how the kernel enforces fair sharing.
Container Internals: Building a Container from Scratch
Combine namespaces, cgroups, and filesystem tricks to build a container. No Docker—just Linux primitives. The capstone that uses everything.