Operating Systems carries 5% of the NSCT according to HEC's Areas of Competencies, and it was the weakest area in 2026 at 33.8% average accuracy, per the HEC NSCT report and APP. Print this page and keep it next to your practice: most OS marks come from a handful of fixed formulas, and terms follow Silberschatz.
Key definitions
Term
One line
Process
Program in execution (the program itself is passive)
PCB
State, PID, program counter, registers, scheduling, memory and I/O info
Thread
Own ID, PC, registers and stack; shares code, data, heap and files
Trap
Software-generated interrupt (error or system call)
Mode bit
Kernel = 0, user = 1
Critical-section needs
Mutual exclusion, progress, bounded waiting
Semaphore
Integer with wait() (P, decrement) and signal() (V, increment); no owner
Deadlock
Set of processes each waiting for a resource another holds
Thrashing
Fewer frames than the working set; more paging than computing
Belady's anomaly
More frames, more faults; affects FIFO, not LRU or Optimal
Inode
Attributes and block pointers, not the file name
DMA
Device moves a whole block; one interrupt per block
Formulas
Formula
Variables and notes
TAT = completion − arrival
Turnaround time
WT = TAT − burst
Waiting time in the ready queue
Response = first run − arrival
Time to first service
CPU utilisation = 1 − pⁿ
p = fraction of time waiting on I/O, n = processes in memory
n fork() calls in sequence = 2ⁿ processes
2ⁿ − 1 children; fork() && fork() gives 3
Amdahl speed-up ≤ 1 / (S + (1 − S) / N)
S = serial fraction; ceiling 1 / S
Need = Max − Allocation
Banker's; grant only if Request ≤ Need and ≤ Available
Starves; fix with aging; check whether low number = high priority
Round robin
Yes
Huge quantum = FCFS; better response, usually worse TAT than SJF
Disk scheduling (Silberschatz queue)
Queue 98, 183, 37, 122, 14, 124, 65, 67; head at 53; cylinders 0–199.
Algorithm
Rule
Total head movement
FCFS
Arrival order
640
SSTF
Nearest request next (can starve)
236
SCAN, moving down
Sweep to cylinder 0, then reverse
236
LOOK, moving down
Reverse at the last request (14)
208
C-SCAN, moving up
Sweep to 199, jump to 0, continue up
382 counting the return, 183 without
C-LOOK, moving up
Jump back to the lowest request (14)
322 counting the jump
X vs Y quick distinctions
Pair
Difference
Process vs thread
Own address space vs shared address space, own stack
Monolithic vs microkernel
Services in kernel, fast vs user-space servers, safer, slower
Pre-emptive vs non-pre-emptive
CPU can be taken away vs runs until the burst ends or blocks
Mutex vs semaphore
Has an owner, locked/unlocked vs no owner, integer count
Deadlock vs starvation
Group stuck in a cycle vs one process never served
Prevention vs avoidance
Deny a Coffman condition vs check each request (Banker's)
Paging vs segmentation
Fixed size, internal fragmentation vs variable, external
SCAN vs LOOK
Reverses at the end cylinder vs at the last request
Hard vs symbolic link
Same inode, same file system vs stored path, can dangle
Access list vs capability list
Matrix column per object vs row per domain
Polling vs interrupts vs DMA
CPU busy-waits vs interrupt per word vs interrupt per block
Nonblocking vs asynchronous I/O
Returns what is ready now vs completes later and notifies
Mnemonic for the Coffman conditions: mutual exclusion, hold and wait, no pre-emption, circular wait. All four are needed; break one to prevent deadlock.
Classic traps
Waiting → running and ready → waiting never happen; finished I/O makes a process ready.
A root program still runs in user mode; kernel mode is a CPU state.
Loadable modules do not make Linux a microkernel.
FCFS and round robin cannot starve a process.
6 user threads on 3 kernel threads run at most 3 at once.
In producer-consumer, wait(mutex) before wait(empty) deadlocks on a full buffer.
A RAG cycle means deadlock only with single-instance resources; unsafe is not deadlocked.
Check a Banker's request against Need before Available.
10 ms is 10,000,000 ns, not 10,000.
SCAN goes to the end cylinder; stopping at the last request is LOOK.
Reaching block i under linked allocation takes i reads.
Check whether the question counts the C-SCAN return seek.
Rework every worked number with this page covered, then take a 20-question Operating Systems set in the subject-wise mock test. For more calculation drills across subjects, use numericals practice, and finish with a full NSCT mock test.