Operating Systems
“Understand the invisible machinery behind every program you run.”
A first-principles, student-facing Operating Systems notebook covering core undergraduate concepts and GATE-oriented practice. Learn dual-mode protection, process synchronization, CPU scheduling, deadlock safety, paging and TLBs, demand paging, file systems, and disk scheduling through explanations, models, laboratories, and clearly labelled exam practice.
Structured Notes & Exam Lens
A · B.Tech Structured Study Sequence
9 Sections · Full CurriculumOS Foundations & Kernel Architecture
From bare-metal programming chaos to resource arbitration and clean abstractions.
The hardware mode bit, privileged instructions, and the boundary crossing of system calls.
Processes, Threads & Concurrency
How the OS breathes life into passive disk binaries, structuring virtual memory and PCB control blocks.
The dynamic lifecycle of computation: New, Ready, Running, Waiting, Terminated and Swapping.
The essential illusion of multitasking, and the hidden performance tax it incurs.
How processes talk to each other — and how GATE turns fork() into a counting puzzle.
CPU Scheduling Algorithms
The golden formulas every systems engineer and GATE aspirant must master.
Explore the Convoy Effect, Time Quantum trade-offs, and live Gantt charts.
Non-preemptive SJF, preemptive SRTF (optimal waiting time), Priority scheduling, and Aging.
Process Synchronization & Concurrency
Race conditions, Mutual Exclusion, Progress, Bounded Waiting, and Semaphore operations.
Deadlocks: Principles, Prevention & Avoidance
The four Coffman conditions, cycle detection in RAGs, and the Banker's safety algorithm.
Main Memory Management & Paging
Translating logical addresses, calculating page table sizes, and computing Effective Memory Access Time (EMAT).
Virtual Memory & Page Replacement
From the illusion of infinite memory to page fault service cycles, thrashing dynamics, and replacement heuristics.
File Systems & Storage Architecture
Calculating maximum file sizes with direct, single, double, and triple indirect pointers.
I/O Systems & Disk Scheduling
Minimizing mechanical head seek time across cylinders with real arm trajectory simulations.
B · GATE 2027 Syllabus Scope
Official syllabus scope and related lesson coverage; topics outside the syllabus are marked as enrichment.
- •Processes, threads, inter-process communication, concurrency and synchronization
- •Deadlock detection, prevention and avoidance (Banker's algorithm)
- •CPU and process scheduling (FCFS, SJF, SRTF, Round Robin, Priority)
- •Memory management and virtual memory (Paging, multi-level tables, TLB, Page replacement algorithms)
- •File systems: Unix Inode structure, file allocation methods
- •I/O systems and disk scheduling algorithms (SSTF, SCAN, C-SCAN, LOOK)
Interactive Labs & Verified PYQs
Visual Interactive Laboratories
Process States & Transitions: 5-State vs 7-State Models
The dynamic lifecycle of computation: New, Ready, Running, Waiting, Terminated and Swapping.
Context Switching: Kernel Execution & Hardware Overhead
The essential illusion of multitasking, and the hidden performance tax it incurs.
FCFS & Round Robin Scheduling: Gantt Charts & Time Quantum
Explore the Convoy Effect, Time Quantum trade-offs, and live Gantt charts.
The Critical Section Problem & Semaphores
Race conditions, Mutual Exclusion, Progress, Bounded Waiting, and Semaphore operations.
Deadlock Conditions, RAG & Banker's Algorithm
The four Coffman conditions, cycle detection in RAGs, and the Banker's safety algorithm.
Page Replacement Algorithms: FIFO, Belady's Anomaly, LRU & Optimal
From the illusion of infinite memory to page fault service cycles, thrashing dynamics, and replacement heuristics.
Disk Scheduling: SSTF, SCAN, C-SCAN & LOOK
Minimizing mechanical head seek time across cylinders with real arm trajectory simulations.
Verified GATE Previous Year Questions
Step-by-step verified derivationsWhich of the following is/are NOT the primary responsibility of an operating system kernel? (P) Compiling high-level C programs (Q) Allocating physical frames to virtual memory pages (R) Scheduling threads on available CPU cores (S) Resolving hardware interrupt requests
Compilers (such as GCC or Clang) are user-level application programs and utility software, completely distinct from the OS kernel. Memory management (Q), CPU scheduling (R), and interrupt handling (S) are core responsibilities executed inside the OS kernel.
Which of the following computer machine instructions MUST be privileged? (I) Set value of timer (II) Read the current clock time (III) Clear memory page tables (IV) Turn off interrupts
(I) Setting the hardware timer must be privileged so a rogue process cannot monopolize the CPU by disabling preemption. (II) Reading the time of day is a non-privileged operation (reading time harms nothing). (III) Clearing or modifying memory page tables would destroy virtual memory isolation and must be privileged. (IV) Disabling interrupts (`CLI`) prevents the OS scheduler from preempting the process and must be strictly privileged.
Which of the following components of a program state are NOT shared among threads of the same process? (P) Code segment (Q) Global variables (R) Stack (S) CPU Register values
Threads of the same process share the Text (code) segment, Data/BSS segments (global and static variables), Heap, and open file descriptors. However, each thread must independently execute its own function call sequence and instructions; therefore, each thread maintains its own ==pink:private Stack== and ==pink:private CPU Register values (including Program Counter and Stack Pointer)==.
In an operating system with preemptive scheduling, which of the following process state transitions is NEVER possible?
When an event or I/O for a blocked (waiting) process completes, the kernel moves it to the ==yellow:READY state==. The process can only enter the RUNNING state when chosen by the CPU dispatcher from the ready queue. Direct ==pink:Blocked → Running transition violates OS scheduling invariants==.
Revision & Rapid Review Sheets
Authoritative Textbooks & Video Lectures
All notes in this notebook cross-reference standard academic literature. We do not pretend student notes substitute for classical texts — they guide you through them.
Curated lectures from verified educators (Gate Smashers, Neso Academy, Knowledge Gate, and MIT OCW) selected specifically for difficult concept visualizations.
These notes are open and maintained together.
Found a factual mistake? Have a clearer explanation or mental model? Created a useful diagram or worked out a tricky GATE question? Help make this notebook better for every student who opens it next.