Table of Contents & Subject Index
Tip
Interactive Navigation: All chapter titles, section headers, and subject terms below are direct clickable hyperlinks. Click any entry to jump immediately to that topic in the text or generated PDF.
Part I: Complete Navigable Directory
Front Matter
Foundations: Architecture, Processes & Threads
- 1. The Ontological Necessity of the Operating System
- 2. The Architectural Substrate and Execution Constraints
- 3. Process Abstraction and Lifecycle
- 4. Threaded Execution and Concurrency Hazards
- 5. Scheduling Theory and Policy
- 6. Synchronization and Memory Ordering
- 6.1 Mutual Exclusion and Critical Sections
- 6.2 Condition Variables and Predicate-Based Synchronization
- 6.3 Deadlock: Causes and Prevention (Coffman Conditions)
- 6.4 Atomic Compare-And-Swap (
compare_exchangevs.compare_exchange_weak) - 6.5 Hardware Memory Ordering, Store Buffers, and Litmus Tests
- 6.6 Synchronization Beneath the Primitives: Futexes and Seqlocks
Memory, Kernel Boundary & Durability
- 7. Virtual Memory and the Architecture of Address Translation
- 8. Memory Allocation and Management Strategies
- 9. The Kernel Boundary and the Cost of System Calls
- 10. Asynchronous Notifications and Signal Semantics
- 11. Inter-Process Communication (IPC)
- 12. File System Architecture and Durability
Networking, Daemons & Scalable Systems
- 13. I/O Multiplexing and the Event Loop
- 14. Network Protocols and the Socket Interface
- 15. Daemon Lifecycle and Service Supervision
- 16. Virtualization and Containerization
- 17. Multiprocessor Systems and Hardware Accelerators
- 18. Performance Analysis and Observability
Interview Problems & Reference Implementations
- 19. Systems Interview Problems: Derivations and Reference Implementations
- 19.1 Architectural Framework and Problem-Solving Discipline
- 19.2 The Bounded Blocking Queue
- 19.2.1 Concurrency Model and Synchronization Primitives
- 19.2.2 State Invariants and Predicate Verification
- 19.2.3 Reference Implementation (C++20 & Rust 2024)
- 19.2.4 Backing-Store Variants and Building the Ring Buffer by Hand
- 19.2.5 Memory Layout: The
Option<T>Tag, Niche Optimization, andMaybeUninit<T> - 19.2.6 Systems Analysis and Concurrency Interview Follow-Ups
- 19.3 The Free-List Allocator
- 19.4 The Lock-Free Single-Producer Single-Consumer (SPSC) Ring Buffer
- 19.5 Byte Routines:
memmove,strlenandatoi - 19.6 The LRU Cache
- 19.7 The Reader-Writer Lock
- 19.8 The Thread Pool
- 19.9 The Process Pipeline:
fork,execandpipe - 19.10 Bit Manipulation
- 19.11 Linked List Operations
- 19.12 Operating System Fundamentals: Six Technical Derivations
- 19.12.1 Process Isolation vs. Thread Concurrency Topology
- 19.12.2 Context Switch Mechanics and Microarchitectural Overhead
- 19.12.3 System Call Traps and Privilege Boundary Enforcement
- 19.12.4 Synchronization Taxonomy: Mutex, Spinlock, and Semaphore
- 19.12.5 Deadlock Dynamics: Coffman Conditions and Prevention Strategies
- 19.12.6 Virtual Memory Architecture and Page Fault Resolution
- 19.13 The Priority Job Scheduler
- 19.13.1 Policy as a Priority Key
- 19.13.2 The Dispatch Loop and Quantum Expiration
- 19.13.3 Reference Implementation: One Logical CPU
- 19.13.4 Complexity and Starvation
- 19.13.5 Extending to a Worker Pool: Problem Contract
- 19.13.6 Synchronization Model and Lock Scope
- 19.13.7 Dispatch Order versus Completion Order
- 19.13.8 Reference Implementation: Worker Pool
- 19.13.9 Error Propagation and Failure Semantics
- 19.13.10 Systems Analysis and Interview Follow-Ups
Part II: Systems Subject & Keyword Index
A thematic, alphabetical cross-reference linking systems topics directly to their foundational derivation and practical implementation.
A
- Abstraction (Hardware Abstraction Layer): The foundational operating system role mediating between complex physical hardware and uniform software primitives (files, sockets, processes).
- Acquire-Release Semantics: Synchronizes shared memory between threads without the heavy hardware penalty of full sequential consistency fences.
- Address Space Layout: Virtual memory organization across text, data, BSS, heap, memory-mapped regions, and user stack.
- Address Translation (Hand Calculation): Complete step-by-step mathematical walk of a 48-bit canonical virtual address through PML4, PDPT, PD, and PT levels to physical address assembly.
- Numerical Walkthrough & Invariants: §7.2.3
- Anonymous Mapping (
MAP_ANON | MAP_PRIVATE): Kernel allocation of zero-initialized demand pages unbacked by physical disk files. - APIC / IO-APIC & ARM GIC (Interrupt Controllers): Two-tier hardware interrupt routing, Message Signaled Interrupts (MSI-X), and priority arbitration across multiprocessor cores.
- Hardware Routing & EOI: §2.4.1
- Apple Silicon Unified Memory (UMA): Shared physical memory substrate between CPU, GPU, and Neural Engine without PCIe bus serialization.
- Architectural Analysis: §17.3
- Async-Signal-Safety: Functions safe to execute inside asynchronous signal handlers without corrupting thread stacks or deadlocking libc mutexes.
- Atomicity Gap: The structural discrepancy between high-level language expressions (
counter++) and low-level load-modify-store sequences causing lost updates. - Atomics (Memory Models): Load and store instructions providing hardware memory synchronization guarantees.
B
- Bare-Metal Execution: The fundamental architectural limitations (no concurrency, no memory protection, no unified device drivers) of executing directly on raw hardware.
- Architectural Invariants: §1.1
- Bit Manipulation (Branchless): Microarchitectural optimizations utilizing bit smearing and hardware popcount instructions.
- Bounded Blocking Queue: Multi-threaded queue that synchronizes producers and consumers under strict capacity limits.
- Buffered I/O (
BufWriter): Amortizing the overhead of user-to-kernel context transitions via large user-space memory buffers.- System Call Trap Overhead: §9.2
- Bump Allocator (Arena): Extreme high-throughput allocation strategy incrementing an offset pointer within contiguous memory.
- Design & Mathematical Alignment: §8.2
C
- Cache Coherence Protocols (MESI / MOESI): Hardware protocols ensuring cache-line consistency across multi-core systems.
- Cache Lines (64-byte Granularity): The atomic transfer unit between L1/L2/L3 caches and main memory.
- Coffman Deadlock Conditions: The four axiomatic conditions required for a system to enter permanent deadlock.
- Condition Variables: Execution barriers enabling threads to sleep until notified of a state change under a controlling mutex.
- Context Switch Overhead: The microarchitectural penalty of saving CPU registers, swapping page tables, and invalidating pipeline state.
- Copy-on-Write (COW): Memory optimization where physical frames are shared as read-only until mutated by child or parent.
D
- Daemons & Detachment Ritual: Creating autonomous background processes detached from terminals and session leaders.
- Data Races: Undefined behavior occurring when concurrent threads access identical memory without synchronization and at least one is a write.
- Demand Paging: Memory virtualization where physical frames are allocated lazily upon page fault rather than reservation.
- Dentry & Inode Topology: The directory cache and file metadata structures governing VFS storage durability.
- Inode Architecture: §12.2
E - F
- Edge-Triggered vs. Level-Triggered Multiplexing: Notification mechanics for ready file descriptors under high concurrency.
- Event Loops (
kqueue/epoll/poll): Scalable single-threaded I/O engines multiplexing thousands of descriptors. - False Sharing: Severe performance degradation caused by distinct CPU cores mutating independent variables residing on the same cache line.
- File Descriptors: Per-process integer indices referencing open file descriptions and inodes in the kernel.
- Frame Pointer (FP / RBP / x29): Invariant structural anchor for function activation records, enabling debugger backtraces and call frame unwinding.
- Architectural Function: §2.1
- Free-List Allocator: Explicit heap allocator with header metadata, block splitting, and contiguous coalescing.
G - L
- Guard Pages (
PROT_NONE): Virtual memory pages configured with zero permissions to detect stack overflows or buffer out-of-bounds accesses.- Protection Mechanics: §7.3
- Huge Pages: 2 MiB / 1 GiB virtual page translations designed to maximize TLB coverage and eliminate translation latency.
- Hardware TLB Reach: §7.2.4
- Interrupt Descriptor Table (IDT) & Top/Bottom-Half Handlers: Hardware vector dispatch table,
TSS.rsp0trapframe saving,hardirqmasking, andsoftirqdeferred execution. - Inter-Process Communication (IPC): Exchanging state across hardware isolation boundaries via pipes, sockets, and shared memory.
- Isolation (Process Protection): Hardware-enforced boundary preventing cross-process interference and securing kernel memory.
- Lock-Free Programming: Concurrency without mutex barriers, relying on atomic instructions and hardware memory ordering guarantees.
- SPSC Queue Derivation: §19.4
- LRU Cache: High-performance eviction cache pairing an O(1) hash table with a doubly-linked list.
- Zero-Allocation Splice Implementation: §19.6
M - P
- Mechanism versus Policy Separation: Foundational architectural principle decoupling invariant low-level hardware mechanisms from tunable high-level allocation algorithms.
- Memory Fences & Ordering: CPU instructions constraining the reordering of loads and stores across memory buses.
- Theoretical Derivation: §6.5
- Multi-Level Page Tables: Tree-structured hierarchical address translation enabling sparse virtual address spaces without wasting physical RAM.
- Non-Blocking I/O (
O_NONBLOCK): System call semantics allowing asynchronous execution without thread suspension. - NUMA Topologies: Non-Uniform Memory Access architectures where latency depends on memory socket locality.
- Optimization Strategies: §17.1
- Page Map Level 4 (PML4): The root table of the 4-level x86-64 page hierarchy loaded into the CR3 control register.
- Translation Walk: §7.2
- Pipeline Deadlocks: Common concurrency pitfall where unclosed write descriptors prevent readers from observing EOF.
- Descriptor Management & Proof: §19.9.4
- POSIX Standard Interface: Standardized system call boundary unifying process management, file I/O, virtual memory, and IPC across UNIX-like systems.
- Core API Taxonomy: §1.4
- Priority Inversion: Scheduling hazard where a high-priority thread blocks on a resource held by a low-priority thread.
- Priority Inheritance Solutions: §5.4
- Process Control Block (PCB): Kernel data structure maintaining architectural register state, page tables, and file descriptors.
- Program Counter (PC / RIP / PC_EL0): Microarchitectural register holding the linear virtual address of the next instruction to fetch.
R - S
- Reader-Writer Lock: Synchronization primitive permitting concurrent readers while restricting writers to exclusive access.
- Writer-Preference Implementation: §19.7
- Resource Management (Arbitration): Operating system orchestration and time/space multiplexing of CPU cores, memory frames, and I/O bandwidth.
- Ontological Necessity: §1.2
- Shared Memory (
mmap/ POSIXshm): Highest-throughput IPC mechanism bypassing the kernel during data exchange.- Zero-Copy Implementation: §11.2
- Signal Coalescing & Reaping: POSIX signal delivery property requiring non-blocking loops to prevent zombie leaks.
SIGCHLDandwaitpid: §10.3
- Sparse Files: File system structures where unwritten data blocks are unallocated, saving physical storage.
- Block Allocation Mechanics: §12.3
- Spurious Wakeups: Condition variable unblocking without explicit notification caused by kernel scheduler dynamics.
- Systems Nuances: §19.2.6
- Stack Pointer (SP / RSP / SP_EL0): Architectural register tracking the active boundary of the descending call stack.
- Status Flags (FLAGS / RFLAGS / PSTATE): CPU condition codes (ZF, CF, SF, OF) and interrupt mask control flags (IF).
- Condition Evaluation: §2.1
- System Call Boundary: Hardware-supervised privilege gatekeeper transferring control from user mode to kernel mode.
T - Z
- TCP Protocols & Sockets: Reliable, connection-oriented byte streams with flow control and congestion avoidance.
- Socket Interface Mechanics: §14.1
- Thread Pool: Concurrency architecture amortizing thread creation costs across a fixed pool of persistent worker threads.
- Implementation & RAII Shutdown: §19.8
- Thundering Herd Mitigation: Preventing catastrophic CPU contention by waking single threads (
notify_one) rather than all sleeping threads.- Bounded Queue Optimization: §19.2.6
- TLB (Translation Lookaside Buffer): High-speed CPU hardware cache storing recent virtual-to-physical address translations.
- Architecture & Invalidation: §7.2
- Virtual Memory Architecture: Core isolation mechanism presenting processes with private, contiguous address spaces.
- Zombie Processes: Terminated processes awaiting parent retrieval of exit status, retaining a PID table slot.