What the subject covers
An operating system (OS) shares one machine's CPU, memory, disks and devices among many programs, and gives them a safe, simple interface: system calls, files, processes. The exam side has two halves: concepts with numbers (scheduling, deadlock, paging, disk scheduling) and practical knowledge (Linux commands and shell basics, Windows file systems and tools) that an IT Officer uses at work.
Key topics
Basics
- Kinds of OS.
- Batch, multiprogramming (several jobs in memory), multitasking/time-sharing (fast switching between jobs), multiprocessing (several CPUs), distributed, and real-time.
- Real-time systems are hard (a missed deadline is a failure) or soft.
- Kernel. A monolithic kernel runs most services inside the kernel; a microkernel keeps the kernel small and runs services in user space. Programs enter the kernel through system calls, switching from user mode to kernel mode.
- Booting: firmware (BIOS or UEFI), then the boot loader, then the kernel.
Processes and threads
- Process vs thread. A process is a program in execution, with its own address space and a process control block (PCB). Threads in one process share its memory and files but have their own stack and registers.
- Process states: new → ready → running → waiting (blocked) → ready … → terminated; running → ready on preemption or when the time slice ends. A context switch saves one PCB and loads another.
- fork(). In Unix, fork() creates a child process. A program that calls fork() n times in a row (each child also continuing) ends up with 2ⁿ processes, of which 2ⁿ − 1 are child processes.
- Zombie vs orphan. A zombie has finished but its parent hasn't collected its exit status; an orphan's parent has exited.
CPU scheduling
- Measures.
- Turnaround time = completion time − arrival time.
- Waiting time = turnaround − burst time.
- Response time = first run − arrival.
- Also know throughput and CPU utilisation.
- Algorithms.
- FCFS: simple; a long job holds up the short ones behind it (the convoy effect).
- SJF: non-preemptive; the optimal average waiting time among non-preemptive algorithms when all jobs are available and burst times are known (SRTF is optimal overall).
- SRTF: the preemptive version of SJF.
- Priority: low-priority jobs can starve; ageing (slowly raising their priority) fixes this.
- Round robin: a fixed time quantum. Too large and it behaves like FCFS; too small and context switches waste time.
- Multilevel queue / multilevel feedback queue.
- Worked check (our example). P1 arrives at 0 with a burst of 5, P2 at 1 with 3, P3 at 2 with 1. Under FCFS:
- completions are 5, 8 and 9;
- turnaround times are 5, 7 and 7 (average 6.33);
- waiting times are 0, 4 and 6 (average 3.33).
Synchronisation
- The critical-section problem. A solution needs mutual exclusion, progress and bounded waiting. Peterson's solution covers two processes.
- Tools.
- Semaphores: wait/P decrements and may block; signal/V increments. They are counting or binary.
- A mutex lock is owned by one thread at a time.
- Monitors wrap shared data with its access procedures.
- Classic problems: producer–consumer (bounded buffer), readers–writers, dining philosophers. Also know race conditions.
Deadlocks
- The four necessary conditions (Coffman): mutual exclusion, hold and wait, no preemption, circular wait. Break any one and deadlock can't happen; that is prevention.
- Avoidance with Banker's algorithm.
- Need = Max − Allocation.
- A state is safe if some order exists in which every process can finish with the Available resources plus what earlier processes release.
- An unsafe state may, but need not, lead to deadlock.
- Detection and recovery. Use a wait-for graph or resource-allocation graph. With one instance of each resource, a cycle means deadlock; with several instances, a cycle is necessary but not enough. Recover by killing processes or preempting resources.
- Starvation is not deadlock. In starvation the system progresses but one process never gets served.
Memory management
- Fragmentation. Contiguous allocation (first, best or worst fit) causes external fragmentation, which compaction fixes. Fixed-size blocks cause internal fragmentation.
- Paging.
- A logical address is split into page number + offset; the page table maps pages to frames.
- A TLB caches page-table entries.
- Effective access time ≈ hit ratio × (TLB + memory) + miss ratio × (TLB + 2 × memory), for a single-level table.
- Segmentation: variable-sized logical units (code, data, stack); it can be combined with paging.
- Virtual memory and demand paging.
- A page fault loads a page from disk when it is needed.
- The dirty (modified) bit marks pages changed in memory: only dirty pages must be written back when replaced.
- Thrashing is when the system spends more time paging than working.
- Page replacement.
- FIFO can suffer Belady's anomaly: more frames, more faults.
- Optimal replaces the page used furthest in future; it is the theoretical best.
- LRU approximates Optimal and has no Belady's anomaly.
Files and disks
- File allocation: contiguous, linked (FAT is a variant), indexed (Unix inodes). Know directory structures and access methods (sequential, direct).
- Disk scheduling. Total head movement is the sum of the distances between successive positions.
- FCFS: requests in the order they arrive.
- SSTF: the nearest request first; it can starve far requests.
- SCAN (the "elevator"): goes to the end of the disk, then reverses.
- C-SCAN: returns to the start and sweeps one way only.
- LOOK and C-LOOK: like SCAN and C-SCAN, but turn at the last request instead of the disk end.
- RAID: 0 (striping, no redundancy), 1 (mirroring), 5 (striping with distributed parity), 10 (mirror + stripe).
Linux and Windows in practice
- Linux commands.
- Files and directories:
ls (-l long, -a include hidden, -t by modification time, -r reverse), cd, pwd, cp, mv, rm, mkdir. - Viewing and searching:
cat, less, head, tail, grep, find. - Processes:
ps, top, kill. - Disk use:
df, du. - System information:
uname (-s kernel name, -r kernel release, -a all).
- Permissions.
chmod with rwx = 4/2/1, so 755 = rwxr-xr-x. chown changes the owner. - Shell scripting.
#!/bin/bash (the shebang) names the interpreter.$ expands a variable ($HOME), $1 is the first argument and $? is the last exit status.- A loop looks like
for i in 1 2 3; do …; done.
- Windows.
- File systems: NTFS, FAT32, exFAT, ReFS.
- Partition styles: MBR (older, up to 4 primary partitions) and GPT (UEFI, many partitions).
- BitLocker is full-volume (often called full-disk) encryption; Hyper-V is Microsoft's hypervisor.
- Recovery tools such as
bootrec repair boot records.
How it is asked
These are the facts about the format from the official IBPS documents:
- Professional Knowledge in the Mains has 50 questions for 100 marks in 40 minutes (2 marks each, −0.50 for a wrong answer).
- Each question has five options.
IBPS doesn't publish past papers. Based on memory-based papers shared by candidates (unofficial) for two previous IT Officer Mains exams (January 2023 and December 2024; possibly incomplete), OS questions came in two clear styles:
- Numerical problems. One paper had a Banker's-algorithm question (count the safe sequences from given Allocation, Max and Available matrices), FCFS average waiting and turnaround times, and total head movement for FCFS disk scheduling. These take longer than one-liners, so budget time for them.
- Practical one-liners. Linux and Windows came up in both papers:
- Linux:
ls options, uname, the meaning of $ and /bin/bash, valid Bash loop syntax; - Windows: file-system names, partition styles, BitLocker, Hyper-V and a boot-repair command.
- Concept questions on starvation and the dirty bit also appeared.
We don't give a number of OS questions, because IBPS publishes no weightage.
Common mistakes
- Mixing up turnaround and waiting time. Waiting = turnaround − burst. Always subtract the arrival time, not 0.
- Banker's algorithm. Work with Need (Max − Allocation), not Max. After a process finishes, add its Allocation back to Available.
- "An unsafe state is a deadlock." It isn't; it only means deadlock is possible.
- "A cycle in a resource graph always means deadlock." That's only true with single-instance resources.
- fork() count. n fork() calls give 2ⁿ processes in total but 2ⁿ − 1 child processes; check which the question asks for.
- Belady's anomaly. It affects FIFO, not LRU or Optimal.
- Disk head movement. Start from the initial head position given in the question, and add absolute differences.
- Internal vs external fragmentation: paging has internal fragmentation (the last page), contiguous allocation has external.
- uname options:
-s is the kernel name, -r the kernel release (version number).
Two-week study plan
A suggestion. Adjust it to your own pace.
| Days | Focus | Practice |
|---|
| 1 | OS types, kernel, system calls, booting | One-page summary in your own words |
| 2–3 | Processes, threads, PCB, states, fork | fork() output questions |
| 4–5 | CPU scheduling (FCFS, SJF, SRTF, priority, RR, MLFQ) | 2 Gantt charts per algorithm, with average waiting and turnaround |
| 6 | Synchronisation, semaphores, classic problems | Trace semaphore values step by step |
| 7–8 | Deadlocks, Banker's algorithm, RAG | 5 Banker's problems: find a safe sequence and test a request |
| 9–10 | Paging, TLB, segmentation, virtual memory, page replacement | Count page faults for FIFO, LRU and Optimal on the same reference string |
| 11 | File systems, disk scheduling, RAID | Head movement for all six algorithms on one request queue |
| 12 | Linux commands, permissions, shell scripting; Windows file systems and tools | Practise in a Linux terminal (a free VM or WSL) |
| 13–14 | Mixed revision | Timed set of 25 questions in 20 minutes; review every wrong answer |