OS Complete Notes
OS Complete Notes
■ Star rating = number of times a question has repeated across your uploaded
PYQ papers
Table of Contents
• Module 1 — Introduction to Operating Systems
• Module 2 — Processes, Threads & CPU Scheduling
• Module 3 — Process Synchronization & Deadlocks
• Module 4 — Memory Management & Virtual Memory
• Module 5 — Disk Structure, File Systems & I/O
• Final Exam Priority Ranking (All Modules Combined)
MODULE 1: Introduction to Operating Systems
■■ Hinglish:
Socho OS ek 'manager' hai jo tumhare computer ke andar sab kaam manage karta hai. Tum bas 'print karo'
bolte ho, aur OS peeche se CPU, memory, printer driver sab set kar deta hai. Bina OS ke, hardware sirf 'dumb'
machine hai.
■ Real-life Example:
Think of a hotel manager. You (the guest/user) don't directly deal with kitchen staff, cleaning staff, or electricity.
You just tell the manager 'I want food,' and the manager (OS) coordinates chefs (CPU), rooms (memory), and
services (I/O) for you.
■ Mnemonic:
PIMFEC — Process, I/O, Memory, File, Error handling, Communication — 'PIMFEC manages everything for
you!'
■ PYQ Highlight:
• Define Operating System and mention any two functions of an OS (AM401 Test-II, appeared twice: 2024-25 &
2025-26) ■■
• Which is NOT a function of OS? (c) Compiler design (CT401 Q9) ■■
■■ Hinglish:
Pehle ek time pe sirf ek program chal sakta tha. Phir 'batch' mein similar kaam ikattha karke process kiya gaya
(jaise bank cheque clearing raat mein). Multiprogramming mein CPU idle nahi baithta — jab ek process wait
kare, CPU doosre pe switch ho jaata hai. Time-sharing mein itni fast switching hoti hai ki har user ko lagta hai
'mera hi computer hai'.
■ Real-life Example:
Batch processing = doing laundry: collect all dirty clothes through the day, wash together at night in one batch.
Time-sharing = a shared WiFi router — every device seems to work 'at the same time', but the router is
switching between devices very fast.
■ Mnemonic:
'Shim Bit My Toe, Dude!' → Serial → Batch → Multiprogrammed → Time-sharing → Distributed/modern.
■ PYQ Highlight:
• The first generation of OS was based on: (a) Batch processing (CT401 Q1) ■■
• Explain the evolution of OS / Differentiate batch vs time-sharing OS — appeared in AM401 Test-I AND Test-II
(2025-26) AND Test-II (2024-25) ■■■
■■ Hinglish:
Batch = exam copies checked together without talking to each student. Multiprogrammed = chef cooking 3
dishes together, chopping one while another is in the oven. Time-sharing = cyber café, 10 people on one
server, each feels it's their own PC. Real-time = car airbag system (hard) vs video streaming buffering (soft).
Distributed = WhatsApp — your phone, server, friend's phone all separate but feels like one system. Parallel =
gaming PC with multiple cores running a heavy game together.
■ Real-life Example:
Real-time OS = a traffic signal controller — a 2-second delay could cause an accident (hard real-time).
Compare to a food delivery app ETA — 2 minutes late is just mild annoyance (soft real-time).
■ Mnemonic:
'Bade Miyan Time se Real Distance Paar karte hain' → Batch, Multiprogrammed, Time-sharing, Real-time,
Distributed, Parallel.
■ PYQ Highlight:
• Compare and contrast batch, multi-programmed, time-sharing, real-time, distributed, parallel OS with examples
(CT401 Q13, 5 marks) ■■■
• Which OS serves multiple users at same time? (MCAN-202 Q3) — appeared in two exam sets ■■
• Explain different types of OS with examples (AM401 Test-I) ■
4. Structural Overview of OS
■■ English:
Simple/Monolithic structure – everything in one big block (e.g. early MS-DOS). Layered approach – OS divided
into layers, each built on top of lower one. Microkernel – minimal core in kernel, most services run as user-level
processes (more stable, more communication overhead). Modular approach – core kernel components +
dynamically loaded service modules (e.g. modern Linux).
■■ Hinglish:
Layered structure jaise ek building — ground floor (hardware) ke upar 1st floor, uske upar 2nd floor... har floor
sirf apne neeche/upar wale floor se connect hota hai. Microkernel mein sirf zaroori cheez kernel mein rakho,
baaki bahar shift kar do taaki agar ek service crash ho toh poora system na gire.
■ Real-life Example:
Microkernel = a company with outsourced departments. Core team (kernel) handles only critical stuff; HR,
cleaning, catering are outsourced — if catering fails, the whole company doesn't crash.
■ Mnemonic:
'Simple Log Mat Miss karo' → Simple → Layered → Microkernel → Modular.
■ PYQ Highlight:
• Not yet asked as standalone in your uploaded PYQs, but explicitly listed in syllabus — keep ready as a 2–3 mark
backup answer.
■■ Hinglish:
Protection ghar ke andar ke rules jaise hai — 'chhote bhai ko bade bhai ka room use karne ki permission nahi'.
Security bahar ke chor se bachna hai — door lock, CCTV, alarm (firewall, antivirus, authentication).
■ Real-life Example:
Protection = office key-card system — even employees can't enter every room, only authorized ones. Security =
the security guard at the gate who stops outsiders (hackers) from entering the building at all.
■ Mnemonic:
'CIA never sleeps' → Confidentiality, Integrity, Availability.
■ PYQ Highlight:
• Important objectives of computer security: (d) All of these — Confidentiality, Integrity, Availability (MCAN-202
Q7) ■■
• Describe how security mechanisms in OS help protect system resources and data (CT401, 5 marks) ■■
• Describe about the types of security attacks (MCAN-202, 8 marks) ■
1. Process Concept
■■ English:
A process is a program in execution. A program is passive code on disk; a process is that code actively running,
with its own memory space, CPU registers, program counter, and resources. Components: Text section (code),
Program counter, Stack, Data section, Heap.
■■ Hinglish:
Program ek 'recipe' hai kaagaz pe likhi hui. Jab tak tum khana nahi bana rahe, woh sirf ek document hai. Jaise
hi tum kitchen mein khada ho ke recipe follow karna shuru karte ho, woh 'process' ban jaati hai — active,
resources use kar rahi hai.
■ Real-life Example:
A recipe in a cookbook = program. You actually cooking that recipe right now = process. Same recipe, if 3
people cook it simultaneously in 3 kitchens = 3 different processes from 1 program.
■ Mnemonic:
process = program + PC + resources ALIVE
■ PYQ Highlight:
• A process is: (a) A program in execution (IT403 Q5) ■■
2. Process States
■■ English:
A process moves through: New (being created) → Ready (waiting for CPU) → Running (executing) →
Waiting/Blocked (waiting for I/O or event) → Terminated (finished). Transitions loop between
Ready/Running/Waiting until termination.
■■ Hinglish:
Socho tum doctor ke clinic mein ho: New = registration ho raha hai. Ready = waiting room mein baithe ho.
Running = doctor ke room mein checkup chal raha hai. Waiting = X-ray room mein ho (CPU se hat gaye).
Terminated = checkup complete, ghar chale gaye.
■ Real-life Example:
A hospital OPD queue: new patient registration → waiting room (ready) → doctor's cabin (running) → lab test
(waiting/blocked) → back to waiting room (ready again) → discharged (terminated).
■ Mnemonic:
'New Recruits Run, Wait, Then leave' → New, Ready, Running, Waiting, Terminated.
■ PYQ Highlight:
• Explain process states with a suitable diagram — AM401 (Test-I AND Test-II, both 2024-25 & 2025-26) ■■■
• Explain Process State Model with a neat diagram (IT403 Q21, 15 marks) ■■
• 'A page fault occurs when the process enters blocked state' distractor option (MCAN-202 Q9) ■
■■ Hinglish:
PCB ek 'identity card + file' hai jo OS har process ke liye banata hai. Jaise hospital mein har patient ki file hoti
hai jisme naam, status, dawaiyan sab likha hota hai. Context switch pe OS is file ko save karta hai taaki baad
mein wahi se continue kar sake.
■ Real-life Example:
PCB = your medical file at a hospital. Even if you go home and come back next month, the doctor picks up your
file and knows exactly where you left off, without starting from zero.
■ Mnemonic:
'Please Save Record, Manage And Inform' (PSRMAI) → Process state, Scheduling info, Registers, Memory
info, Accounting, I/O status.
■ PYQ Highlight:
• What is a Process Control Block (PCB)? — AM401 (2025-26 Test-II, 2024-25 Test-II), MCAN-202 Q16, IT403
Q10 (full form) — most repeated definition ■■■■
• Analyze how PCB helps in process management (AM401 Test-I) ■■■
• A PCB does NOT contain: (d) System clock (CT401 Q6 — trick MCQ) ■■
• Explain the need for PCB (MCAN-202 Q18) ■■
■■ Hinglish:
Call center jaisa socho. Job queue = sab customers jinhone call kiya. Ready queue = jo IVR se guzar chuke,
agent ka wait kar rahe. Device queue = jo 'hold' pe hai kyunki specific department busy hai. Long-term
scheduler decide karta hai kitne naye aane do; short-term decide karta hai agla kaunsa milega.
■ Real-life Example:
Ready queue = people standing in a bank line waiting for the next available cashier. Device queue = people
called but waiting specifically for the 'loan officer' who's busy.
■ Mnemonic:
'Long term decides Entry, Short term decides Turn'
■ PYQ Highlight:
• Explain process scheduling in an OS. How does OS manage execution of multiple processes? (CT401 Q14, 5
marks) ■■
■ Real-life Example:
WhatsApp + music app sharing a voice note = co-operating. Minimizing a heavy game to attend a call =
suspended process (not closed, just paused).
■ Mnemonic:
'ICS: Independent = Isolated, Co-operating = Connected, Suspended = Sleeping'
■ PYQ Highlight:
• No dedicated PYQ found yet, but directly from syllabus wording — keep as a 2-mark backup answer.
6. Threads
■■ English:
A thread is the smallest unit of execution within a process — a 'lightweight process'. Threads within one process
share address space, code, and data, but have own stack, registers, and program counter. Benefits:
responsiveness, resource sharing, economy, multiprocessor utilization. User-level threads: managed by user
library, kernel unaware, fast but one blocking call can block all. Kernel-level threads: managed by OS kernel
directly, slower to create/switch but more robust and can be scheduled across CPUs.
■■ Hinglish:
Process ek ghar hai; threads uss ghar ke members hain. Sab shared resources (address, kitchen, wifi) use
karte hain, but har member apna kaam (stack, registers) independently karta hai. User-level thread = family
khud manage karti hai bina society office ko bataye — fast but ek atka toh sab ruk sakte. Kernel-level thread =
society office ko har member ka record hai — slow but robust.
■ Real-life Example:
A restaurant kitchen (process) — different chefs (threads) share kitchen, ingredients, stove (shared address
space), but each chops/stirs independently (own stack/PC). If kernel is aware of each chef individually
(kernel-level threads), others keep working even if one takes a break.
■ Mnemonic:
'Threads SHARE the House, but each has OWN Room' → Shared: Address space, Heap, cOde. Own:
Registers, PC, Stack.
■ PYQ Highlight:
• Differentiate user-level vs kernel-level threads, advantages/disadvantages — CT401 Q19(b) + MCAN-202 Q1
(MCQ) ■■■■
• Differentiate thread and process. Explain need for PCB. What is context switching? (MCAN-202 Q18, 15 marks)
■■■
• Differentiate between process and thread — AM401 (multiple sessions: Test-I & Test-II, both years) ■■■
• Which is NOT shared by threads? (a) Stack (MCAN-202 Q1) ■■
■■ Hinglish:
Non-preemptive = bank counter clerk finishes current customer fully before next, even if VIP arrives.
Preemptive = emergency room — heart attack patient jumps the queue over a normal checkup.
■ Real-life Example:
Non-preemptive = a single till at a grocery store, finishing current billing fully. Preemptive = an ambulance at a
traffic signal — even with right of way, you must stop and let it pass.
■ Mnemonic:
'Non-preemptive = No interruption; Preemptive = Priority can Push'
■ PYQ Highlight:
• Explain preemptive and non-preemptive scheduling; which is which (CT401 Q20a, AM401 variants) ■■■
• Preemptive scheduling executes until: (b) higher priority process arrives (CT401 Q2) ■■
• What are the various scheduling criteria an OS considers? (CT401 Q22b, 8 marks) ■■
• Analyze the impact of context switching on system performance (AM401 Test-I Q4) ■■
Multilevel FeedbackLike
Queue
multilevel queue, but processes can move
Office between
promotion/demotion
queues (promote/demote).
based on performance.
Lanes that let you SWITCH based on behavio
P1 0 7 0 7 0 7
P2 1 5 7 12 6 11
P3 2 3 12 15 10 13
Avg Waiting = (0+6+10)/3 = 5.33 Avg Turnaround = (7+11+13)/3 = 10.33
■ PYQ Highlight:
• FCFS numerical (avg waiting/turnaround) — IT403 Q19, Q20; AM401 Test-II Q10; MCAN-202 Q19 — appears in
almost EVERY paper ■■■■
• Which gives minimum avg waiting time? (b) SJF (IT403 Q6) ■■■■
• Round Robin: what happens if time quantum too small/large? (MCAN-202 Q18) ■■■■; Compare FCFS and RR
(AM401, 3 times) ■■■■
• Round Robin quantum=2, calculate avg waiting/turnaround (IT403 Q19c) ■■■
• SRTF: calculate avg waiting/turnaround (IT403 Q20c) ■■■
• List any two CPU scheduling algorithms and their purpose (AM401 Test-I Q5) ■
• Multiprocessor feedback queue scheduling (MCAN-202 Q17) ■■
■ Module 2 – Quick PYQ Summary Table
Topic Question Stars
■■ Hinglish:
Tum aur roommate ek hi bank account se ATM se paisa nikal rahe ho, ek hi time pe. Dono ko nahi pata doosra
bhi nikal raha hai — balance galat calculate ho sakta hai. Yehi race condition hai.
■ Real-life Example:
Two people trying to book the last movie ticket at the exact same second — without synchronization, both might
get 'confirmed' for the same seat.
■ Mnemonic:
'Race condition = Racing to touch the SAME data first — whoever wins last, corrupts it'
■ PYQ Highlight:
• What is a race condition? How do synchronization mechanisms prevent it? (CT401 Q17, 5 marks) ■■
• What is a race condition? (AM401, 2 marks) ■■
■■ Hinglish:
Critical section jaise single-seater washroom — sirf ek insaan andar (mutual exclusion). Khaali hai toh koi wait
kar raha insaan andar jaa sakta hai bina wajah ruke (progress). Koi ek insaan hamesha line cut nahi kar sakta
(bounded waiting).
■ Real-life Example:
A shared office printer with a lock — one person enters (mutual exclusion), if empty someone waiting can go in
(progress), no one can hog the queue forever (bounded waiting).
■ Mnemonic:
'MPB — My Personal Bathroom rules' → Mutual exclusion, Progress, Bounded waiting.
■ PYQ Highlight:
• What is critical section problem? — AM401 (both Test-I and Test-II, 2025-26) ■■■
• What is a critical section in process synchronization? (AM401 2024-25 Test-II) ■■
• Difference between entry and exit sections? (AM401 2024-25 Test-II) ■
3. Synchronization Hardware
■■ English:
Hardware-based atomic instructions solve the critical section problem simply. Test-and-Set(): tests and sets a
value atomically (uninterruptible), used to implement locks. Compare-and-Swap(): compares and swaps a value
atomically. Faster than software-only solutions.
■■ Hinglish:
Tum aur dost ek switch control kar rahe ho. Agar 'check karo aur turant on kar do' ek hi atomic step mein ho
(beech mein interrupt na ho), confusion nahi hoga.
■ Real-life Example:
A library's single 'book available' light switch that flips and locks in one motion — nobody can grab the book
while someone else is mid-check.
■ Mnemonic:
'Test-and-Set = Test aur turant Set — no gap for cheating!'
■ PYQ Highlight:
• No dedicated direct PYQ yet — conceptually tied to syllabus 'synchronization hardware', keep as backup 2–3
mark answer.
4. Semaphores
■■ English:
A semaphore S is a special integer variable used for process synchronization, accessed only via wait(S)/P(S)
(decrements S; blocks if S<0) and signal(S)/V(S) (increments S; wakes a blocked process). Binary Semaphore
(Mutex Lock): value 0 or 1, for mutual exclusion. Counting Semaphore: unrestricted range, controls access to
multi-instance resources.
■■ Hinglish:
Semaphore ek token/counter system hai. Parking lot mein 5 spots hain (counting semaphore=5). Car aane pe
counter -1 (wait/P), car jaane pe +1 (signal/V). Counter 0 pe pahunche toh naye cars wait karte hain.
■ Real-life Example:
Counting semaphore = a restaurant with 10 tables. Counter decreases when seated (wait), increases when a
group leaves (signal). At 0, new customers wait outside.
■ Mnemonic:
'P for Pause (decrement, maybe wait), V for Vamoose/Void (increment, free up)'
■ PYQ Highlight:
• Explain semaphores with example / Define and explain Semaphore in detail — MCAN-202, AM401 (2024-25 &
2025-26 Test-II) — extremely repeated ■■■■
• Semaphore value 7, then 20 P and 15 V ops. Resulting value? Answer = 7-20+15 = 2 (MCAN-202 Q8) ■■
• A semaphore is: (b) Special integer variable used for synchronization (CT401 Q10) ■■
• Semaphore is used for: (a) Process synchronization (IT403 Q11) ■
• Which is a synchronization tool? (b) Semaphore (IT403 Q4) ■
• What is PCB? Can any integer variable act as semaphore? (MCAN-202 Q16) ■■
■ Real-life Example:
A printer queue — an app (producer) sends jobs to a limited-size queue; the printer (consumer) picks jobs off it.
Full queue = app waits; empty queue = printer idles.
■ Mnemonic:
'Producer fills the Bucket, Consumer empties the Bucket — mutex is the Bucket's single handle'
■ PYQ Highlight:
• Explain semaphore and discuss producer-consumer problem — AM401 (both 2025-26 and 2024-25 Test-II)
■■■
• Describe the Producer-Consumer problem using semaphores (AM401 2024-25 Test-II Q8) ■■
■■ Hinglish:
Google Doc jaisa — bahut log ek saath dekh (read) sakte hain, lekin jab koi edit mode mein likhna shuru karta
hai, tab tak koi doosra edit nahi kar sakta.
■ Real-life Example:
A library reference book — many students read simultaneously at different tables, but if the librarian updates a
page (write), everyone else must stop reading.
■ Mnemonic:
'Readers can Share, Writers need to be Alone'
■ PYQ Highlight:
• Grouped under 'classical synchronization problems with solutions' (AM401 Test-I Q10a) ■■
■■ Hinglish:
5 dost round table pe, beech mein 5 chopsticks. Sab ek saath apna left wala chopstick uthaa lein toh sabko
right wale ka wait karna padega jo neighbour ke paas hai — koi kabhi khaa nahi payega.
■ Real-life Example:
Like 4 cars at a 4-way intersection with no signal, all arriving at once, each waiting for the car to its right to go
first — nobody moves.
■ Mnemonic:
'Dining Philosophers = Deadlock at Dinner — everyone's hungry, nobody eats'
■ PYQ Highlight:
• Dining philosopher problem is a classic example of: (a) Deadlock (IT403 Q7 MCQ) ■■
6. Deadlocks — Characterization
■■ English:
A deadlock occurs when a set of processes are blocked, each holding a resource and waiting for another held
by another process in the set. Four necessary conditions (all must hold): (1) Mutual Exclusion, (2) Hold and
Wait, (3) No Preemption, (4) Circular Wait.
■■ Hinglish:
4 dost hain jinke paas ek-ek cheez hai jo doosre ko chahiye — A ke paas pen jo B ko chahiye, B ke paas
notebook jo C ko chahiye... sab apni cheez chhodne se mana kar rahe hain (no preemption), sab circular wait
mein hain.
■ Real-life Example:
Two cars on a single-lane bridge approaching from opposite ends, each blocking the other, neither willing to
reverse — classic traffic deadlock.
■ Mnemonic:
'MHNC — Mutual, Hold, No-preempt, Circular'
■ PYQ Highlight:
• What is deadlock? Mention the 4 necessary conditions — AM401 (Test-II 2025-26, rephrased in 2024-25 Test-II)
— very high repeat ■■■■
• Explain the concept of deadlock and necessary conditions (CT401 Q16) ■■■
• Necessary and sufficient conditions for deadlock (MCAN-202 Q15) ■■■
• Which condition is necessary for deadlock? (d) All of the above (CT401 Q4) ■■
• What is starvation and how is it different from deadlock? (AM401 2024-25 Test-II) ■
■■ Hinglish:
Prevention = 'aisi rule banao ki deadlock ho hi na sake'. Avoidance = 'pehle check karo, request grant karne se
pehle' jaise bank loan dene se pehle credit score check. Detection/Recovery = 'hone do, phir fix karo' jaise
traffic jam solve karne police bulao.
■ Real-life Example:
Prevention = airport security rules making hijacking structurally impossible. Avoidance = bank checking financial
situation before loan approval. Detection/Recovery = traffic flowing freely but police ready to untangle a jam.
■ Mnemonic:
'PAD — Prevent, Avoid, Detect(+recover)'
■ PYQ Highlight:
■ Mnemonic:
'Banker checks the Balance before saying Yes — Need ≤ Available = Safe to proceed'
■ PYQ Highlight:
• How Banker's Algorithm is used for deadlock avoidance, with full matrix — MCAN-202 Q22b, CT401 Q20c,
AM401 2024-25 Test-II Q10 — your MOST repeated 15-mark numerical ■■■■
• Which sequence is a safe sequence? (MCAN-202 Q4, tape drives MCQ) ■■
• What is a safe state in deadlock avoidance? (AM401 2024-25 Test-II) ■■
• Which method is used to prevent deadlocks? (d) All of the above (CT401 Q5) ■■
• What are the strategies for deadlock prevention? (CT401 Q20c) ■
■ Mnemonic:
'Detect first, then either Kill or Snatch (preempt) to recover'
■ PYQ Highlight:
• Using the Deadlock Detection Algorithm, determine deadlock; recover by terminating processes (CT401 Q18a, 5
marks) ■■■
• Discuss how deadlock can be detected using Resource Allocation Graph (AM401 2024-25 Test-II Q9) ■■
■ Module 3 – Quick PYQ Summary Table
Topic Question Stars
■■ Hinglish:
Online food order jaisa — tum app mein 'Table 5' order karte ho (logical address), lekin kitchen mein order
actual 'Counter 12, Shelf 3' pe process hota hai (physical). Waiter/MMU beech mein translate karta hai.
■ Real-life Example:
Your home address written on a courier package (logical — 'House No.5, Green Society') vs the GPS
coordinates the delivery app actually uses (physical) — MMU is the translator between them.
■ Mnemonic:
'Logical = what you SEE (Program's view), Physical = what's REAL (RAM's view)'
■ PYQ Highlight:
• Given logical address space 16MB, page size 4KB, calculate pages; physical memory 64MB, how many frames?
(CT401 Q18b, 5 marks) ■■
2. Swapping
■■ English:
Swapping temporarily moves an entire process (swapped out) from main memory to a backing store (disk), and
later brings it back (swapped in) — frees memory for other processes or allows more processes than fit in
memory.
■■ Hinglish:
Phone RAM full ho gaya. Background app ko temporarily disk mein 'park' kar deta hai (swap out); jab chalani
ho, wapas RAM mein laata hai (swap in).
■ Real-life Example:
Like a valet parking system — when the lot (RAM) is full, the valet moves some cars to an overflow lot (disk)
temporarily, bringing them back when needed.
■ Mnemonic:
'Swap OUT to disk when RAM is tight, Swap IN when it's your turn again'
■ PYQ Highlight:
• Swapping is: (b) Moving process to secondary memory (IT403 Q2) ■■■
• Where does swap space reside? (c) DISK (MCAN-202 Q2) — appeared in two exam sets ■■
■■ Hinglish:
Parking lot jaisa socho. First-fit: pehla khaali spot jisme car fit ho jaye. Best-fit: sabse tight-fitting spot. Worst-fit:
sabse bada khaali spot. External fragmentation = poore lot mein jagah hai but tukdo mein bikhri hai. Internal
fragmentation = motorcycle ke liye car-size spot diya, extra jagah waste.
■ Real-life Example:
External fragmentation = a bookshelf with scattered small empty gaps — enough total space but no single gap
fits a big book. Internal fragmentation = buying a large moving box for one small item — extra space wasted.
■ Mnemonic:
'First-fit = FAST, Best-fit = TIGHT (small leftover), Worst-fit = BIG leftover' / 'External = scattered outside
gaps, Internal = wasted inside the box'
■ PYQ Highlight:
• Given partitions 100K,500K,200K,300K,600K, place processes 212K,417K,112K,426K using First/Best/Worst-fit;
which is most efficient? (IT403 Q13, 5 marks) ■■■
• Explain differences between external/internal fragmentation. How does paging minimize fragmentation? (CT401
Q21b) ■■■
• Write short note on Compaction, fragmentation (IT403 Q18) ■■
• Size of partition for 9kb program (best-fit)? (CT401 Q12) ■■
4. Paging
■■ English:
Solves external fragmentation by dividing logical memory into fixed-size pages and physical memory into
fixed-size frames (same size). A process's pages load into any available frames (not necessarily contiguous).
Page table maps page number → frame number. Advantages: no external fragmentation, easier allocation.
Disadvantages: internal fragmentation remains, extra memory access for page table lookup (solved by TLB).
■■ Hinglish:
Ek badi book ko chapters mein todna — har chapter (page) same fixed size ka hai, kisi bhi shelf (frame) mein
rakha ja sakta hai, contiguous hona zaroori nahi. Index (page table) batata hai 'Chapter 3 shelf number 7 pe
hai.'
■ Real-life Example:
Like a library storing a multi-volume encyclopedia — each volume (page) can go anywhere on shelves (frames),
and a catalog card (page table) tells you exactly which shelf.
■ Mnemonic:
'Pages in Program, Frames in physical memory, Page Table is the MAP connecting them'
■ PYQ Highlight:
• Which scheme suffers from external fragmentation? (a) Segmentation — NOT paging (MCAN-202 Q12) — trick
MCQ ■■
• What is paging? (IT403 Q22a) ■■
5. Segmentation
■■ English:
Memory divided into variable-sized segments based on logical program divisions (code, data, stack segments)
— matches programmer's view, unlike paging's fixed division. Segment table maps segment number to base
address + limit. Can suffer external fragmentation since segments vary in size.
■■ Hinglish:
Ghar ko rooms mein divide karna based on purpose — bedroom, kitchen, living room — har room ka size alag
(variable-size), paging ke fixed-size 'boxes' jaisa nahi.
■ Real-life Example:
Organizing a house move by room-type boxes (kitchen box, bedroom box) — each different size, unlike paging
where every box is forced equal.
■ Mnemonic:
'Segmentation = Sensible divisions (variable, logical), Paging = Plain equal slices (fixed)'
■ PYQ Highlight:
• 64 segments, max segment size 512 words — bits in logical address? log2(64)=6 + log2(512)=9 = 15 bits
(MCAN-202 Q10) ■■
• Write short note on Segmentation (IT403 Q18a) ■■
■■ Hinglish:
Phone ke recently dialed numbers list jaisa hai. Recently call kiya number turant yaad rehta hai (cache hit);
naya number poori contact list search karni padegi (cache miss).
■ Real-life Example:
Like your browser's recently visited websites/autocomplete — recent sites auto-fill instantly (TLB hit); a new site
needs a full DNS lookup (TLB miss, slower).
■ Mnemonic:
'TLB = Tiny List of shortcuts — check the QUICK list before the LONG list'
■ PYQ Highlight:
• TLB is a kind of: (b) Cache (MCAN-202 Q11) ■■
■■ Hinglish:
Netflix jaisa — poori movie file download nahi hoti, sirf chal raha part buffer mein load hota hai (illusion of large
memory). Demand paging = jab tum kisi part ko dekhna chaho jo buffer mein nahi, 'loading' dikhta hai (page
fault) jab tak fetch nahi hota.
■ Real-life Example:
A buffet with a hidden kitchen — dishes are brought out only as guests request them (demand paging). If a
guest asks for something not yet prepared, there's a small wait (page fault).
■ Mnemonic:
'Virtual Memory = Illusion of Infinite space; Demand Paging = Only fetch what's ASKED for'
■ PYQ Highlight:
• Virtual Memory is a part of: (c) Secondary memory (IT403 Q1) ■■■
• Define virtual memory and paging (AM401 2025-26 Test-II Q5, 2 marks) ■■■
• A page fault occurs: (b) when the page is not in memory (MCAN-202 Q9) ■■
■ Mnemonic:
FIFO = 'First In, First OUT the door' | LRU = 'Long time No see? You're OUT' | Optimal = 'Oracle knows the
Future'
FIFO Frames 4 4,7 4,7,6 7,6,1 7,6,1 7,6,1 7,6,1 6,1,2 1,2,7 1,2,7
Fault? F F F F H H H F F H
Total FIFO Page Faults = 6, Hits = 4, Hit ratio = 0.4, Miss ratio = 0.6
Optimal for same string: Faults occur at 4,7,6,1 (first 4 unique) then at position 8 (replace 6, since it's not
needed again soon) — Total Optimal Faults = 5, Hit ratio = 0.5 (better than FIFO).
■ PYQ Highlight:
• Optimal/FIFO page replacement + hit/miss ratio for string 4,7,6,1,7,6,1,2,7,2 — IT403 Q14 AND Q16 (same
string, both algorithms asked) ■■■■■
• LRU page faults for 7,0,1,2,0,3,0,4,2,3,1,0 with 3 frames (CT401 Q18c) ■■■■
• LRU and FIFO faults, 4 frames, string 1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6 + Explain Belady's Anomaly (IT403
Q22b/c) ■■■■ / ■■
• Page faults + best algorithm for 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 (MCAN-202 Q21, 15 marks) ■■■
• Describe the LRU page replacement algorithm (CT401 Q15, 5 marks) ■■■
• Compare LRU and Optimal with examples — AM401 (both Test-II sessions, 2024-25 & 2025-26) ■■■
• Best algorithm in theory? (c) Optimal (CT401 Q11) ■■
• Algorithm that replaces least recently used page? (c) LRU (MCAN-202 Q6) ■■
9. Thrashing & Working Set Model
■■ English:
Thrashing: system spends more time paging (swapping in/out) than executing processes — happens when too
many processes compete for too few frames, causing continuous page faults and very low CPU utilization.
Working Set Model: tracks the set of pages a process actively uses in a recent time window; allocating enough
frames to cover the working set prevents thrashing.
■■ Hinglish:
Bahut chhoti almirah mein 10 logo ka saaman rakhne ki koshish — har 2 minute mein kisi ka saaman nikal ke
doosre ka daalna padta hai, itna time hi 'adjust' karne mein nikal jaata hai. Working set model = 'pichhle 10
minute mein kaun se kaam active the' usi basis pe resources allocate karo.
■ Real-life Example:
Cooking 5 dishes on a stove with only 1 burner — constantly swapping pots, spending more time swapping
than cooking (thrashing). Working set = recognizing you need 3 burners for 3 dishes actively cooking right now.
■ Mnemonic:
'Thrashing = Too much SWAPPING, too little WORKING' / 'Working Set = What's actively NEEDED right
now'
■ PYQ Highlight:
• Thrashing occurs when: (b) processes continuously swap in and out of memory (CT401 Q7) ■■■
• Thrashing is related to: (b) Memory management (IT403 Q3) ■■■
• What is thrashing? How can OS prevent it? (CT401 Q21c, 5 marks) ■■■
• Write short note on Working set model (IT403 Q18d) ■■
TLB MCQ ■■
1. Disk Structure
■■ English:
A disk is a stack of platters, each with two surfaces coated with magnetic material. Each surface has tracks
(concentric circles), each divided into sectors. A cylinder = same track number across all platters (aligned
vertically). Data addressed logically as a 1D array of logical blocks, mapped by the disk controller to physical
(cylinder, track, sector).
■■ Hinglish:
Disk ek round cake jaisa hai jisme concentric circles (tracks) hain. Har ring (track) ko pizza slices jaisa todo —
har slice ek sector. Cylinder = agar multiple cakes (platters) stacked hain, same-radius wale sab rings ek
cylinder banate hain.
■ Real-life Example:
Like a stack of vinyl records — each record is a platter, the grooves are tracks, and a vertical line through the
same groove-position on every record is a cylinder.
■ Mnemonic:
'Track = Ring, Sector = Slice of ring, Cylinder = Same ring across all Platters'
■ PYQ Highlight:
• No isolated MCQ found yet, but foundational for disk scheduling numericals below — keep as backup 2-mark
concept.
FCFS Service requests strictly in arrival order. Simple, fair, but inefficient
Delivery(erratic
boy jo order
head ke
movement).
sequence mein jaata hai, zigzag route, time w
SCAN Head moves one direction servicing all requests, reaches disk
Ek direction
end, thenmein
reverses
chalte(like
jao,an
end
elevator).
pe pahunch ke wapas mudo — elev
C-SCAN Like SCAN, but jumps back to the beginning instead of reversing
End pe—pahunch
more uniform
ke seedha
wait time.
start pe jump karo, beech mein na roke.
LOOK Like SCAN, but only goes as far as the last request (not theSirf
disk's
last physical
order takend)
jao, before
poori street
reversing.
ke end tak nahi.
C-LOOK Like C-SCAN, but only goes to the last request in each direction
C-SCANbefore
jaisa,
jumping
par sirfback.
last order tak, physical end tak nahi.
■ Mnemonic:
FCFS = order, no logic | SSTF = Sprint to Nearest | SCAN = Sweep to the End | C-SCAN = Circular, jump to
Start | LOOK = only to last request | C-LOOK = Circular LOOK
■ PYQ Highlight:
• Disk queue FCFS scheduling, calculate total head movement — IT403 Q15 AND Q17 (same question repeated
twice in same paper!) ■■■■
• Calculate total head movement using FCFS + analyze SSTF performance vs FCFS — AM401 (Test-II, both
2024-25 and 2025-26) ■■■■
• Track requests (23,89,132,42,187), head=100: compute head movement using SSTF, LOOK, FCFS (MCAN-202
Q19, 15 marks) ■■■
• Purpose of disk scheduling algorithms: (a) Minimize seek time (CT401 Q3) ■■■
■■ Hinglish:
Physical formatting jaise kacchi zameen pe plot marking karna. Logical formatting jaise plots pe society ka
record banana. Boot block ek ignition key jaisa hai — chhota starter system poore engine (OS) ko start karta
hai. Bad blocks jaise road pe potholes — unhe use se hata do, alternate route (spare sector) pe divert kar do.
■ Real-life Example:
Bad blocks = a broken elevator button — building management disables it and redirects you to a working button
(spare sector).
■ Mnemonic:
'Boot block = the KEY that starts the OS ENGINE'
■ PYQ Highlight:
• Not directly asked yet as standalone — keep as short-note backup (syllabus explicitly lists it, could appear as
2-mark).
■■ Hinglish:
Sequential access jaise cassette tape sunna — song 5 sunne ke liye 1,2,3,4 se guzarna padega. Direct access
jaise YouTube video — seedha 5th minute pe jump. Indexed access jaise kitaab ka index page — topic
dhoondo, page number mil jaayega.
■ Real-life Example:
Sequential = an old VHS tape (fast-forward through everything). Direct = a DVD/streaming service (jump to any
scene). Indexed = a cookbook's table of contents pointing straight to a page.
■ Mnemonic:
'Sequential = Step by step, Direct = Straight jump, Indexed = Index tells you Instantly'
■ PYQ Highlight:
• Grouped under general 'file system structure' questions — syllabus-listed; safe 2-mark backup.
5. Directory Structure
■■ English:
Single-level: all files in one directory — simple but naming conflicts. Two-level: separate directory per user —
solves naming conflicts, no grouping within a user's files. Tree-structured: hierarchical, most common (like
modern OS folders), efficient searching/grouping. Acyclic-graph: allows shared subdirectories/files between
directories. General graph: allows cycles too, needs care to avoid infinite loops (garbage collection needed).
■■ Hinglish:
Single-level = hostel room jisme sabka saaman ek hi almirah mein — confusion hota hai. Two-level = har
student ki apni almirah. Tree-structured = almirah ke andar drawers, drawers ke andar boxes — nested
organization jaise phone mein Folders > Subfolders > Files. Acyclic-graph = shared Google Drive folder jo do
teams ke folders mein dikhta hai.
■ Real-life Example:
Tree-structured = your computer's folder system — Documents > Projects > OS_Notes > [Link].
Acyclic-graph = a shared Google Drive document linked in two different folders — same file, two paths.
■ Mnemonic:
'Single = One Bucket, Two-level = One Bucket Per User, Tree = Buckets inside Buckets, Acyclic =
Shared Buckets'
■ PYQ Highlight:
• Explain directory structures (MCAN-202 Q20, 15 marks — full explanation) ■■■
• What are different file system structures in modern OS? Discuss advantages (CT401 Q21a) ■■
■■ Hinglish:
Contiguous allocation jaise movie theatre mein ek pura connected row book karna — dhoondhna easy, par
group badhe toh adjacent seats na milne ka risk. Linked allocation jaise treasure hunt — pehla clue dusra
batata hai — ek clue toota toh sab kharab. Indexed allocation jaise restaurant table booking sheet jisme saari
table numbers ek jagah likhi hain — direct dekh sakte ho.
■ Real-life Example:
Contiguous = booking a full connected cinema row. Linked = a scavenger hunt where each note tells the next
spot — lose one note and you can't find the rest. Indexed = a master list at a front desk listing all room numbers
for a wedding party — jump straight to any room.
■ Mnemonic:
'Contiguous = Connected row, Linked = Chain of Clues, Indexed = One master List pointing everywhere'
■ PYQ Highlight:
• Directly listed in syllabus (contiguous, linked, indexed) — not yet isolated as direct PYQ but highly likely; pair with
directory structure answers as backup.
■■ Hinglish:
Attendance register jaisa — har row ek seat hai, '1' likha matlab occupied, '0' matlab khaali. Ek nazar mein pura
chart dekh ke pata chal jaata hai kaunsi seats free hain.
■ Real-life Example:
Like a movie theatre seating chart app showing green (available) and red (booked) seats — instantly tells you
what's free.
■ Mnemonic:
'Bit Vector = 1 bit, 1 block, 1 answer (free or not)'
■ PYQ Highlight:
• Explicitly in syllabus; hasn't shown as isolated PYQ yet but is a safe 2-mark backup answer.
■■ Hinglish:
Polling jaise baar-baar phone check karna 'message aaya kya?' — time waste. Interrupts jaise phone ki
notification bell — jab message aaye, phone khud bata deta hai. DMA jaise security guard ko bol dena 'package
aaye toh room pe rakh dena' — tumhe khud gate pe jaana nahi padta.
■ Real-life Example:
Polling = repeatedly refreshing a delivery app to check status. Interrupts = the app sending a push notification
the moment status changes. DMA = a courier directly delivering to your doorstep without you personally
fetching it from the warehouse.
■ Mnemonic:
'Polling = Pestering constantly, Interrupt = Inform when Ready, DMA = Direct handoff, no CPU
Middleman'
■ PYQ Highlight:
• Explain caching and buffering in I/O; differences and how they optimize performance (CT401 Q22a, 7 marks) ■■
• Describe I/O system and its components with pictorial representation (IT403 Q21, part of 15 marks) ■■
■■ Hinglish:
Buffering jaise water tank — paani supply line se aata hai speed mismatch ke saath, tank temporarily store
karta hai. Caching jaise phone ke recently used apps RAM mein already rakhe hain, bar-bar disk se load nahi
karna padta. Blocking I/O jaise ATM se paisa nikalna — machine ke saamne khade rehna. Non-blocking jaise
online order place karke apna kaam karte rehna.
■ Real-life Example:
Buffering = a water tank smoothing inconsistent municipal water supply. Caching = keeping frequently-used
spices next to the stove instead of the storeroom. Blocking = standing at a bank counter until the transaction
completes. Non-blocking = submitting a form online and walking away, notified later.
■ Mnemonic:
'Buffer = Smooths the Flow, Cache = Speeds up Frequent access, Blocking = Wait and Watch,
Non-blocking = Fire and Forget'
■ PYQ Highlight:
• Explain caching and buffering in I/O — differences and how they optimize performance (CT401 Q22a, 7 marks)
■■
• Syllabus explicitly lists blocking-non blocking I/O — safe backup short-note answer.
■■ Hinglish:
Message passing jaise WhatsApp texting — same room mein nahi ho (shared memory nahi), par messages
bhej ke communicate karte ho. Many-to-one jaise ek hi counter pe multiple tokens — ek atka toh sab ruke.
One-to-one jaise har customer ka apna dedicated counter. Many-to-many jaise flexible counters demand ke
hisaab se. Monitor jaise library reading room jisme sirf ek time pe ek student jaa sakta hai — darwaza khud
lock-unlock hota hai, semaphore ki tarah manually P/V karne ki zaroorat nahi.
■ Real-life Example:
Message passing = sending texts to a friend abroad instead of physically sharing a notebook. Monitor = a smart
meeting room that auto-locks when occupied and notifies the next person, versus a regular room where you'd
manually put up a 'Do Not Disturb' sign and risk forgetting (semaphore).
■ Mnemonic:
'Message Passing = Texting, not Sharing; Monitor = Auto-locking smart room (safer than manual key)'
■ PYQ Highlight:
• Listed explicitly in syllabus's Case Study section — no isolated PYQ found yet in uploaded papers, but likely a
fresh question this term — worth preparing a solid 5-mark answer.
Important (■■■):
• Batch vs Time-sharing / evolution of OS
• Critical section problem
• User vs Kernel-level threads
• Deadlock detection numerical
• Memory allocation (First/Best/Worst-fit) numerical
• Directory structures