Operating System Notes
Subject Overview
Operating System covers process management, synchronization and CPU scheduling, deadlock handling, and memory/
Subject at a glance
4
Units
38
Topics
4
Credits
4
Infographics
Unit-wise Syllabus
4 units — open any unit for detailed topic-wise notes, diagrams and important exam questions
- Definition and functions of an operating system
- OS as resource manager
- kernel and shell structure
- evolution and types of operating systems
- process definition/states/PCB/scheduling queues/schedulers/context switch
- inter-process communication
- threading and multithreading models
- multicore programming and OpenMP basics
- 1. New: Being created
- 2. Ready: Waiting for CPU
- 3. Running: Executing
- 4. Waiting: Blocked on I/O
- 5. Terminated: Finished
Study guide
This unit covers OS functions, the resource manager view, kernel and shell, types of OS, processes (states, PCB, queues, schedulers, context switch), IPC, threads and multithreading models and multicore programming with OpenMP basics. Draw the process state diagram.
- Critical section problem
- mutex locks
- semaphores
- bounded buffer and reader-writer problems
- CPU scheduling concepts and criteria
- single/multiprocessor and real-time scheduling
- deadlock necessary conditions
- resource allocation graph
- prevention
- avoidance
- detection and recovery
Mutual exclusion
Resource used by one at a time
Hold and wait
Holding one, waiting for another
No preemption
Resources can't be taken away
Circular wait
Closed chain of waiting processes
Study guide
You study the critical section problem, mutex locks, semaphores, classic problems (bounded buffer, readers-writers), CPU scheduling, multiprocessor and real-time scheduling and deadlocks: conditions, graphs, prevention, avoidance, detection and recovery. Practise scheduling and Banker's algorithm problems.
- Address binding
- dynamic linking and loading
- contiguous and non-contiguous memory allocation
- fragmentation types
- paging
- segmentation
- virtual memory and demand paging
- page replacement algorithms
- frame allocation
- thrashing
FIFO
Oldest page in memory
Simple; suffers Belady's anomaly
Optimal
Page not used for the longest time ahead
Best possible; needs the future
LRU
Least recently used page
Close to optimal; widely used
LFU
Least frequently used page
Can keep old heavy pages too long
Study guide
You study address binding, dynamic loading, contiguous and non-contiguous allocation, fragmentation, paging, segmentation, virtual memory, page replacement, frame allocation and thrashing. Practise page replacement tables.
- Secondary storage structure
- disk scheduling and management
- RAID structure
- I/O traffic controller and scheduler roles
- file concepts and access methods
- directory and disk structure
- file system implementation
- protection and security
- Linux and Windows case studies
FCFS
In request order
Fair but slow
SSTF
Nearest request next
Fast; may starve far requests
SCAN (elevator)
Sweeps end to end
Balanced
C-SCAN
One direction, then jumps back
More uniform wait times
Study guide
You study secondary storage, disk scheduling, RAID, I/O management, file concepts, directories, file system implementation, protection and security with Linux and Windows case studies. Compare Linux and Windows file systems.
Why Operating System Matters
Operating system concepts underpin cloud, DevOps, security and systems programming, and are tested in nearly every technical interview.
How to Prepare for Operating System
- Practise scheduling, deadlock and page replacement numericals.
- Use Linux regularly to see the concepts in action.
- Learn the classic synchronisation problems and their solutions.
Operating System: Frequently Asked Questions
What is a deadlock?
A deadlock is a situation where processes wait forever for resources held by each other.
