SUBJECT NOTEBOOK|Computer Science · B.Tech · GATE CS

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.

09 SECTIONS · 15 NOTES · 07 LABS
MODE 01 · UNDERSTAND & LEARN

Structured Notes & Exam Lens

Two parallel study perspectives

A · B.Tech Structured Study Sequence

9 Sections · Full Curriculum
01

OS Foundations & Kernel Architecture

2 notes
1.1Why Operating Systems Exist: The Dual Role

From bare-metal programming chaos to resource arbitration and clean abstractions.

1.2Dual-Mode Execution, Hardware Protection & System Calls

The hardware mode bit, privileged instructions, and the boundary crossing of system calls.

02

Processes, Threads & Concurrency

4 notes
2.1The Process Concept, Memory Layout & The PCB

How the OS breathes life into passive disk binaries, structuring virtual memory and PCB control blocks.

2.2Process States & Transitions: 5-State vs 7-State Models

The dynamic lifecycle of computation: New, Ready, Running, Waiting, Terminated and Swapping.

Lab included~20mRead →
2.3Context Switching: Kernel Execution & Hardware Overhead

The essential illusion of multitasking, and the hidden performance tax it incurs.

Lab included~20mRead →
2.4Inter-Process Communication: Pipes, Shared Memory & Message Passing

How processes talk to each other — and how GATE turns fork() into a counting puzzle.

03

CPU Scheduling Algorithms

3 notes
3.1Scheduling Metrics & Criteria: Arrival, Burst, Turnaround & Waiting

The golden formulas every systems engineer and GATE aspirant must master.

3.2FCFS & Round Robin Scheduling: Gantt Charts & Time Quantum

Explore the Convoy Effect, Time Quantum trade-offs, and live Gantt charts.

Lab included~24mRead →
3.3SJF, SRTF & Priority Scheduling: Optimal Turnaround & Starvation

Non-preemptive SJF, preemptive SRTF (optimal waiting time), Priority scheduling, and Aging.

04

Process Synchronization & Concurrency

1 note
4.1The Critical Section Problem & Semaphores

Race conditions, Mutual Exclusion, Progress, Bounded Waiting, and Semaphore operations.

Lab included~24mRead →
05

Deadlocks: Principles, Prevention & Avoidance

1 note
5.1Deadlock Conditions, RAG & Banker's Algorithm

The four Coffman conditions, cycle detection in RAGs, and the Banker's safety algorithm.

Lab included~24mRead →
06

Main Memory Management & Paging

1 note
6.1Paging, Multi-Level Page Tables & The TLB

Translating logical addresses, calculating page table sizes, and computing Effective Memory Access Time (EMAT).

07

Virtual Memory & Page Replacement

1 note
7.1Page Replacement Algorithms: FIFO, Belady's Anomaly, LRU & Optimal

From the illusion of infinite memory to page fault service cycles, thrashing dynamics, and replacement heuristics.

Lab included~28mRead →
08

File Systems & Storage Architecture

1 note
8.1Unix Inodes & File Allocation Methods

Calculating maximum file sizes with direct, single, double, and triple indirect pointers.

09

I/O Systems & Disk Scheduling

1 note
9.1Disk Scheduling: SSTF, SCAN, C-SCAN & LOOK

Minimizing mechanical head seek time across cylinders with real arm trajectory simulations.

Lab included~22mRead →

B · GATE 2027 Syllabus Scope

Official syllabus scope and related lesson coverage; topics outside the syllabus are marked as enrichment.

GATE 2027 CS/IT scope
Official syllabus topics:
  • •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)
MODE 02 · ACTIVE PRACTICE

Interactive Labs & Verified PYQs

7 Simulators · 15 Verified Questions

Verified GATE Previous Year Questions

Step-by-step verified derivations
GATE CS 2014 · 1 MarkKernel = Minimal set of software managing hardware resources.

Which 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

Answer: A. P only

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.

GATE CS 2021 · 1 MarkAny instruction that can halt the CPU, alter memory mapping, disable preemption, or issue direct I/O is privileged.

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

Answer: B. I, III and IV only

(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.

GATE CS 2021 · 1 MarkThread private state = ==purple:Stack + CPU Registers (PC, SP) + State==.

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

Answer: B. R and S only

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)==.

GATE CS 2017 · 1 MarkBlocked → Ready → Running (==pink:Never Blocked → Running==).

In an operating system with preemptive scheduling, which of the following process state transitions is NEVER possible?

Answer: C. Blocked → Running

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==.

MODE 03 · HIGH-SPEED RETRIEVAL

Revision & Rapid Review Sheets

One-page mental models
MODE 04 · ACADEMIC CITATION TRAIL

Authoritative Textbooks & Video Lectures

Primary Sources
Recommended Textbooks

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.

Video Lecture Playlists

Curated lectures from verified educators (Gate Smashers, Neso Academy, Knowledge Gate, and MIT OCW) selected specifically for difficult concept visualizations.

MODE 05 · OPEN STUDENT COLLABORATION

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.