Operating Systems
Use C to investigate how an operating system organises work. Explore scheduling, memory, files, and inter-process communication towards a small kernel model.
What helps
C Foundations provide the language entry point. Pointers, memory, data structures, and binary values are useful context for the main projects.
C pathway
Programming Foundations / Practice rooms / Track curriculum and enrollment
Processes
Represent process records, save and restore execution context, validate lifecycle transitions and manage a bounded process table. Then follow parent-child relationships and model numbered system calls and file descriptors. These array-based exercises explain process bookkeeping without creating host processes.
- The Process Control Block: 5 lessons
- The Five-State Lifecycle: 5 lessons
- The Process Table: 5 lessons
- Fork & the Family Tree: 5 lessons
- System Calls: 5 lessons
CPU Scheduling
Simulate CPU scheduling and compare completion, waiting, response and turnaround measures. Build FCFS, shortest-job selection, round-robin and priority/aging rules, with explicit assumptions about arrival times and ties. The outputs describe modeled workloads rather than measurements of a host scheduler.
- The Metrics: 5 lessons
- First-Come, First-Served: 5 lessons
- Shortest Job First: 5 lessons
- Round Robin: 5 lessons
- Priority & MLFQ: 5 lessons
Synchronization & Deadlock
Trace shared-state interleavings, lock and semaphore transitions, bounded-buffer operations and deadlock conditions. Use wait-for graphs and a safety algorithm to reason about progress. The C functions simulate these decisions sequentially; they are not thread-safe synchronization primitives for a real concurrent program.
- Race Conditions: 5 lessons
- Locks: 5 lessons
- Semaphores: 5 lessons
- Producer-Consumer: 5 lessons
- Deadlock: 5 lessons
Memory Allocation
Represent a finite heap as blocks, select holes with placement policies, split allocations and coalesce adjacent free space. Measure internal and external fragmentation, then study aligned power-of-two buddies. The project manipulates allocation metadata in arrays rather than replacing the host malloc implementation.
- Placement Policies: 5 lessons
- Split & Allocate: 5 lessons
- Coalescing: 5 lessons
- Fragmentation: 5 lessons
- The Buddy System: 5 lessons
Virtual Memory
Split addresses into page numbers and offsets, encode page-table flags, track free frames and cache translations in a TLB. Finish by assembling a bounded two-level virtual-memory model with demand allocation, access flags, unmapping and cache invalidation. It models translation metadata, not hardware execution or stored page contents.
- Address Anatomy: 5 lessons
- The Page Table: 5 lessons
- Page Faults: 5 lessons
- The TLB: 5 lessons
- Multi-Level Tables: 5 lessons
Page Replacement
Run page-reference traces through FIFO, LRU, Clock and the offline optimal policy. Compare observable fault counts, study FIFO anomalies and LRU inclusion, and relate a working set to available frames. These trace results depend on the specified workload and do not establish universal runtime performance rankings.
- Reference Strings: 5 lessons
- FIFO: 5 lessons
- LRU: 5 lessons
- The Clock Algorithm: 5 lessons
- The Optimal Oracle: 5 lessons
File Systems
Build block arithmetic, inode-style pointers, allocation bitmaps, FAT links, path lookup and permission selection. Finish with an in-memory named-file store that creates, reads and removes actual text while keeping its metadata consistent. Real filesystems persist data; this bounded model does not write a disk image or survive a restart.
- Blocks & Sizes: 5 lessons
- Inodes: 5 lessons
- The Free-Space Bitmap: 5 lessons
- FAT Chains: 5 lessons
- Directories & Permissions: 5 lessons
Disk & I/O
Model mechanical head movement under FCFS, SSTF, SCAN and C-SCAN, then study cache accounting, read-ahead, striping, mirroring and XOR parity. Queue, throughput and percentile exercises make the assumed units explicit. These calculations describe chosen models, not measured SSD or disk latency.
- Seek Arithmetic: 5 lessons
- Elevator Scheduling: 5 lessons
- The Buffer Cache: 5 lessons
- RAID & Parity: 5 lessons
- The I/O Stack: 5 lessons
The Shell & IPC
Learn space-based tokenization, pipe capacity, status selection, modeled signals and job transitions. Assemble a bounded command interpreter with real text pipelines, in-memory redirection and an injectable input/output loop. Its finite course demo uses supplied programs and model jobs; it does not fork or execute host commands.
- Tokenizing: 5 lessons
- Pipes: 5 lessons
- Exit Status: 5 lessons
- Signals: 5 lessons
- Job Control: 5 lessons
Capstone: A Mini Kernel
Assemble a mini-kernel simulator from process loading, round-robin dispatch, frame allocation, FIFO eviction and syscall transitions. Execute bounded instruction streams, advance through blocked-only intervals, reclaim memory at exit and account for instruction and idle ticks. This is an ordinary C simulation, not a bootable or privileged kernel.
- Boot: 5 lessons
- The Dispatcher: 5 lessons
- Kernel Memory: 5 lessons
- Syscalls & Blocking: 5 lessons
- Boot to Idle: 5 lessons