Operating Systems
Start with the job of an operating system and the main types of systems. Then follow a system call from an application into protected kernel code.
Continue with processes, threads, scheduling, shared data, virtual addresses, page tables, and physical memory.
Operating systems
Understand what happens when code executes. An operating system bridges software and hardware.
- Introduction to Operating Systemslesson
Services, resources, protection, and the path from an application to hardware.
- Types of Operating Systemslesson
Batch, time-sharing, real-time, distributed, mobile, and embedded systems.
- Kernel, User Mode, and System Callslesson
Privilege levels, APIs, traps, kernel services, and return to user mode.
- Monolithic Kernelslesson
One address space for every subsystem: why calls are cheap and why any driver bug is a kernel bug.
- Microkernelslesson
Keeping only address spaces, threads, and IPC privileged, and why IPC cost decides the design.
- Operating System Boot Processlesson
Reset vector to init: the firmware handoff, why a bootloader exists, and Secure Boot's chain of trust.
- Distributed Operating Systemslesson
The transparency goals, why partial failure defeated the single-system image, and what replaced it.
Processes, threads, and CPU scheduling
Follow a program as the OS creates it, schedules it, pauses it, and lets multiple threads share work.
- Processes, Threads, and CPU Schedulinglesson
Process state, threads, context switches, ready queues, and scheduling decisions.
- Process States and the PCBlesson
New, ready, running, waiting, and terminated states plus the data saved during a switch.
- CPU Scheduling Algorithmslesson
First-come-first-served, shortest-job-first, priority, round robin, and response-time trade-offs.
- Earliest Deadline First Schedulinglesson
Dynamic deadline priorities, the 100% utilisation bound, and why EDF collapses under overload.
- Deadline Monotonic Schedulinglesson
Fixed priority ordered by relative deadline, with exact response time analysis.
- Real-Time Operating Systemslesson
Hard, firm, and soft deadlines, WCET, and the priority inversion that stalled Mars Pathfinder.
- Shortest Job First Schedulinglesson
Pick the shortest ready burst next, and see why the optimal average wait needs a length nobody knows.
- Inter-Process Communicationlesson
Pipes, shared memory, message queues, and sockets.
Synchronization and deadlocks
See why shared data can become incorrect and how operating systems coordinate threads and processes.
- Race Conditions and Critical Sectionslesson
Identify interleavings that produce wrong results and isolate the code that needs protection.
- Mutexes, Semaphores, and Monitorslesson
Control access to shared resources and coordinate producers with consumers.
- Deadlockslesson
Mutual exclusion, hold-and-wait, no preemption, circular wait, prevention, avoidance, and recovery.
Memory management
Learn how the OS gives every process a private address space while using a limited amount of physical memory.
Address spaces
How a process gets memory that looks private and contiguous when the hardware offers neither.
Fragmentation
Free memory that cannot be used. Start with the overview, then take each kind on its own — they have different causes, different sizes and different cures.
- Memory Fragmentation and Compactionoverview
The two wastes, how they differ, and when sliding blocks together is possible at all.
- Internal Fragmentationlesson
Waste inside a block you were given, bounded at half a page per allocation.
- External Fragmentationlesson
Enough free memory in total, no single run long enough to use it.
Allocation strategies
Given a list of free holes and a request, which hole do you take? Start with the overview, then take each strategy on the same hole list so the outcomes compare directly.
- Memory Allocation Algorithmsoverview
Four strategies compared on one hole list, and why best fit is misnamed.
- First Fitlesson
Take the first hole that fits and stop scanning — fastest, and hard to beat.
- Best Fitlesson
Take the tightest hole, scan the whole list, and leave slivers nobody can use.
- Worst Fitlesson
Take the largest hole on purpose, and watch it perform worst in practice.
- Next Fitlesson
Resume the scan where the last one ended instead of restarting at the front.
Page replacement
When memory is full and a new page is needed, something resident has to go. Start with the overview, then take the four algorithms in turn — each is traced on the same reference string, so the fault counts compare directly.
- Page Replacement Algorithmsoverview
How the OS chooses a resident page to evict when memory is full.
- Optimal Page Replacementlesson
Evict the page needed furthest ahead — the floor no real algorithm can beat.
- FIFO Page Replacementlesson
Evict the oldest arrival, and meet Belady's anomaly.
- LRU Page Replacementlesson
Evict the least recently used page, and why exact LRU is unaffordable.
- Clock Page Replacementlesson
Second chance: one free hardware bit buys LRU's fault count at FIFO's cost.
Files, storage, I/O, and protection
Complete the picture with persistent data, device communication, access control, and isolated execution.
Files on disk
How data is laid out on a device, and how the system finds it again.
Disk scheduling algorithms
Seek time dominates a spinning disk, so the order requests are served in decides the cost. Start with the overview, then take each policy on the same queue.
- Disk Scheduling and I/Ooverview
How a request reaches the device, and why the order it is served in decides the cost.
- Device Driverslesson
How a driver turns a generic read into register writes, and why interrupts and DMA both exist.
- FCFS Disk Schedulinglesson
Serve requests in arrival order, with no reordering at all.
- SSTF Disk Schedulinglesson
Always take the nearest pending request, and the starvation that buys.
- SCAN Disk Schedulinglesson
Sweep to the edge of the disk and reverse, like a lift.
- C-SCAN Disk Schedulinglesson
Sweep in one direction only, jumping back without serving.
- LOOK Disk Schedulinglesson
Turn at the last request rather than at the disk edge.
- C-LOOK Disk Schedulinglesson
One-directional LOOK: jump to the lowest request, not to zero.
Protection and isolation
Who is allowed to touch what, and how one machine safely runs another inside itself.