Skip to content
Tutorials Center
My learning

Topics

Operating Systems Tutorial

Learn Operating Systems step by step: 66 lessons in 12 chapters on processes, threads, scheduling, synchronization, deadlocks, memory, file systems, I/O, security and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is an Operating System? Learn what an operating system does: it manages the CPU, memory, storage and devices, hides hardware details, and protects programs from each other. Includes a live demo.
  2. 2 Types of Operating Systems Compare batch, multiprogramming, time-sharing, multiprocessing, distributed, real-time and embedded operating systems, and see why multiprogramming raises CPU use.
  3. 3 Kernel, User Mode and System Calls Understand the kernel, user mode versus kernel mode, interrupts, traps and system calls, and watch real open, write, read and close calls run in a live Python demo.
  4. 4 How a Computer Boots Follow the boot process step by step: power-on, firmware (BIOS or UEFI), POST, the bootloader, kernel start-up and the first user process. Includes a boot simulator.
  5. 5 OS Structure: Monolithic, Layered, Microkernel Compare operating system designs: simple, monolithic, layered, microkernel, modular and hybrid kernels, with trade-offs in speed, safety and flexibility and a crash demo.

Processes

  1. 6 What Is a Process? Learn what a process is, how it differs from a program, what its memory layout (text, data, heap, stack) looks like, and inspect a live process in Python.
  2. 7 Process States and the Process Control Block Learn the five process states (new, ready, running, waiting, terminated), the transitions between them, the PCB fields and the process table, with a state machine simulator.
  3. 8 Context Switching Understand how the OS saves one process's state and loads another's: the steps of a context switch, what triggers it, its overhead, and a simulator that measures the cost.
  4. 9 Process Creation and Termination Learn how processes are created with fork and exec, how the process tree forms, how wait and exit work, and what zombie and orphan processes are, with a fork simulator.
  5. 10 Inter-Process Communication (IPC) Learn how processes exchange data: shared memory, message passing, pipes, FIFOs, message queues, sockets and signals, with runnable pipe and mailbox demos.

Threads and Concurrency

  1. 11 What Is a Thread? Learn what a thread is, what threads share and what they keep private, how threads differ from processes, and why they make programs responsive, with runnable simulations.
  2. 12 User-Level and Kernel-Level Threads, Multithreading Models Compare user-level and kernel-level threads and the many-to-one, one-to-one and many-to-many models, with a simulator showing why one blocking call can stall user threads.
  3. 13 Benefits and Pitfalls of Multithreading See why multithreading improves responsiveness and speed, what limits the speedup (Amdahl's law), and how races, deadlocks and debugging problems appear, with simulations.
  4. 14 Thread Pools and Implicit Threading Learn why servers use thread pools instead of one thread per request, how work queues, fork-join and thread-local storage work, and compare process-based and thread-based multitasking.

CPU Scheduling

  1. 15 CPU Scheduling Basics Learn what CPU scheduling is, the CPU-I/O burst cycle, preemptive vs non-preemptive scheduling and the criteria (throughput, turnaround, waiting, response), with a metrics calculator.
  2. 16 FCFS and SJF Scheduling Learn First-Come First-Served and Shortest Job First scheduling with worked Gantt charts, the convoy effect, why SJF is optimal for waiting time, and how to predict burst length.
  3. 17 SRTF and Priority Scheduling Learn Shortest Remaining Time First (preemptive SJF) and priority scheduling, preemptive and non-preemptive, with Gantt charts, static vs dynamic priorities and runnable simulators.
  4. 18 Round Robin Scheduling Learn Round Robin CPU scheduling: the time quantum, ready queue rotation, a worked Gantt chart, how the quantum affects response time and overhead, and a runnable simulator.
  5. 19 Multilevel Queue and Feedback Queue Scheduling Learn multilevel queue and multilevel feedback queue scheduling: separate queues per process class, demotion and priority boosts, with a runnable MLFQ simulator.
  6. 20 Starvation, Aging, Dispatcher and Scheduler Understand starvation and aging, how starvation differs from deadlock and livelock, and the exact roles of the scheduler and the dispatcher, with simulations of both.
  7. 21 Real-Time and Multiprocessor Scheduling Learn real-time scheduling with hard and soft deadlines, rate-monotonic and earliest-deadline-first algorithms, plus multiprocessor scheduling, affinity and load balancing, with simulators.

Synchronization

  1. 22 Race Conditions and Why Synchronization Exists See how two threads that share data can corrupt it, why counter++ is not atomic, and how to explore every interleaving with a small Python simulation.
  2. 23 The Critical-Section Problem and Peterson's Solution Learn the three requirements of a critical-section solution, see why naive locks fail, and test Peterson's algorithm against thousands of schedules.
  3. 24 Hardware Support, Mutexes and Spinlocks Understand atomic instructions such as test-and-set and compare-and-swap, build a spinlock, see how a mutex sleeps instead, and when to choose which.
  4. 25 Semaphores: Counting, Binary and Signaling Learn how semaphores work with wait and signal, the difference between counting and binary semaphores, and run a tiny Python kernel that blocks and wakes threads.
  5. 26 The Producer-Consumer (Bounded Buffer) Problem Solve the bounded-buffer problem with three semaphores, see why the order of wait calls matters, and watch a deadlock appear in a runnable Python simulation.
  6. 27 The Readers-Writers Problem Allow many readers or one writer at a time. Build the readers-preference and writer-friendly semaphore solutions and measure writer starvation in Python.
  7. 28 Dining Philosophers and the Sleeping Barber Solve two classic synchronization puzzles with semaphores. Compare deadlock-prone and deadlock-free philosophers and simulate a barber shop with limited chairs.
  8. 29 Monitors and Condition Variables Learn how a monitor bundles data, a lock and condition variables, why you wait in a while loop, and build a bounded buffer and philosophers with a Python simulation.
  9. 30 Priority Inversion, Starvation, Aging and Livelock Understand three ways threads fail to make progress without a deadlock: priority inversion, starvation fixed by aging, and livelock. Simulate each in Python.

Deadlocks

  1. 31 Deadlock: Definition and the Four Necessary Conditions What a deadlock is, the four Coffman conditions that must all hold, how a two-lock deadlock happens, and how many resources make a system deadlock-free.
  2. 32 Resource Allocation Graphs and Cycle Detection Draw and read resource allocation graphs, learn when a cycle means deadlock, and run cycle detection and graph reduction for single and multiple instances.
  3. 33 Deadlock Prevention: Breaking One of the Four Conditions Prevent deadlocks by making one Coffman condition impossible: spooling, all-at-once requests, preemption and global lock ordering, with runnable Python experiments.
  4. 34 Deadlock Avoidance and the Banker's Algorithm Learn safe and unsafe states, run the safety algorithm and the resource-request algorithm step by step, and see the banker's algorithm avoid every deadlock in Python.
  5. 35 Deadlock Detection, Recovery and the Ostrich Algorithm Detect deadlocks with wait-for graphs and the detection algorithm, recover by killing a victim or preempting resources, and learn why many systems simply ignore deadlock.

Memory Management

  1. 36 Memory Management Basics: Addresses, Binding and the MMU Learn logical and physical addresses, address binding times, base and limit registers, the MMU, dynamic loading and linking, and overlays, with Python simulations.
  2. 37 Contiguous Memory Allocation and Fragmentation Compare fixed and variable partitions, first-fit, best-fit, worst-fit and next-fit allocation, understand internal and external fragmentation and compaction.
  3. 38 The Buddy System and Swapping See how the buddy allocator splits and merges power-of-two blocks, why the buddy address is a single XOR, and how swapping moves whole processes to disk.
  4. 39 Paging and Page Tables Learn how paging removes external fragmentation, how a logical address splits into page number and offset, how the page table maps pages to frames, and the page-size trade-off.
  5. 40 The TLB and Multilevel Page Tables Speed up address translation with the TLB, calculate effective access time from the hit ratio, and shrink page tables with two-level, hashed and inverted designs.
  6. 41 Segmentation and Segmented Paging Learn how segmentation matches the programmer's view of memory, how segment tables translate and protect addresses, how it compares with paging, and how the two combine.

Virtual Memory

  1. 42 Virtual Memory, Demand Paging and Page Fault Handling Understand virtual memory, demand paging, what happens on a page fault, how page faults hurt effective access time, and why locality of reference makes it all work.
  2. 43 Page Replacement Algorithms: FIFO, LRU, Optimal and Clock Compare FIFO, optimal, LRU, second-chance (clock) and LFU page replacement on the same reference string, and see Belady's anomaly happen in a Python simulation.
  3. 44 Frame Allocation, Thrashing and the Working-Set Model Learn how frames are divided among processes, why too much multiprogramming causes thrashing, and how the working-set model and page-fault frequency prevent it.
  4. 45 Copy-on-Write, Memory-Mapped Files and Kernel Memory Learn how fork uses copy-on-write to share pages, how memory-mapped files turn file I/O into page faults, and how the kernel allocates memory with buddy and slab allocators.

Files and Storage

  1. 46 File Concepts and Access Methods Learn what a file is to an operating system, which attributes and operations it has, and how sequential, direct and indexed access methods work, with Python simulations.
  2. 47 Directory Structures and Path Names Compare single-level, two-level, tree, acyclic-graph and general-graph directories, learn absolute and relative paths, links and mounting, and resolve paths in Python.
  3. 48 File Allocation Methods Understand how a file system places a file's blocks on disk: contiguous, linked, FAT and indexed allocation, with fragmentation, access cost and Python simulations.
  4. 49 Free Space Management See how a file system tracks free disk blocks with bit vectors, linked lists, grouping, counting and space maps, compare their costs, and try each in Python.
  5. 50 The Unix File System, Inodes and Journaling Explore the Unix file system layout (superblock, inodes, block groups), file types, hard and soft links, file permissions and how journaling keeps a crash from corrupting data.

I/O and Disk Scheduling

  1. 51 I/O Hardware, Interrupts and DMA Learn how an operating system talks to devices: ports and controllers, polling, interrupts, DMA, device drivers and the kernel I/O subsystem, with CPU-cost simulations in Python.
  2. 52 Buffering, Caching and Spooling Learn the difference between buffering, caching and spooling, how single, double and circular buffers work, and how a print spooler lets slow devices share a fast CPU.
  3. 53 Disk Structure and Access Time Understand hard disk geometry (platters, tracks, sectors), seek time, rotational latency and transfer time, how SSDs differ, and calculate disk access time with Python.
  4. 54 Disk Scheduling Algorithms (FCFS, SSTF, SCAN, LOOK) Compare FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK disk scheduling with a worked example, total head movement, starvation and fairness, and run every algorithm in Python.
  5. 55 Disk Management, Swap Space and RAID Learn how an OS prepares disks (formatting, partitions, boot blocks, bad blocks), manages swap space, and uses RAID 0, 1, 5, 6 and 10 for speed and fault tolerance, with XOR parity in Python.

Protection, Security and Virtualization

  1. 56 Protection, Domains and Access Control Learn how an operating system enforces protection with dual-mode operation, protection domains, the access matrix, ACLs, capabilities, least privilege and RBAC, with a Python access-matrix model.
  2. 57 Security Threats and Defenses Study the main operating system security threats (malware, buffer overflows, privilege escalation, social engineering) and defenses such as salted password hashing, ASLR, sandboxing and auditing.
  3. 58 Cryptography in the Operating System Learn the cryptography an operating system relies on: symmetric and public-key encryption, hashes, MACs, digital signatures, full-disk encryption, TLS and secure boot, with toy Python demos.
  4. 59 Virtual Machines and Hypervisors Learn how virtualization lets many operating systems share one computer: hypervisor types, trap-and-emulate, hardware assistance, paravirtualization, memory virtualization and live migration.
  5. 60 Containers, Namespaces and cgroups Understand how containers isolate processes with Linux namespaces, limit resources with cgroups, and share image layers, how they differ from virtual machines, with Python simulations.

Projects and Practice

  1. 61 Project: Build a CPU Scheduler Simulator Build a tick-based CPU scheduling simulator in Python that runs FCFS, SJF, SRTF, round robin and priority scheduling, draws Gantt charts and compares waiting, turnaround and response time.
  2. 62 Project: Page Replacement Lab Build a page replacement laboratory in Python: simulate FIFO, LRU, Optimal and Clock, plot fault rates against frame count, reproduce Belady's anomaly and test workloads with locality.
  3. 63 Project: Build a Mini File System Build a tiny file system in Python with a block device, free-space bitmap, inodes, directories, hard links and an fsck checker, and see how crashes leave orphan inodes and leaked blocks.
  4. 64 Project: Disk Scheduling Benchmark Build a disk scheduling benchmark in Python with seeded workloads and an online simulator, compare FCFS, SSTF, LOOK and C-LOOK on throughput, tail latency and starvation.
  5. 65 Project: A Tiny Shell with Pipes Build a tiny command shell simulator in Python that parses command lines, runs commands as streaming filters connected by pipes, handles redirection and &&, and learn the fork, exec, pipe and dup2 behind a real shell.
  6. 66 Operating Systems Practice Problems with Solutions Twelve worked operating systems exam-style problems on paging, TLB, page faults, inodes, disk access, RAID, disk scheduling, round robin, page replacement and the Banker's algorithm, checked by Python.