Operating System – Complete Study Notes (Exam Edition)
Operating System — Complete Study Notes
Simple, exam-focused notes for SSC, Banking (IBPS/SBI/RBI), Railway (RRB), UPSC, and other government exams. Built for fast learning and last-minute revision.
The single most common starting topic in every computer-awareness section.
Definition
An Operating System (OS) is system software that acts as an interface between the user and computer hardware. It manages all hardware and software resources and lets the user run programs. Without an OS, a computer cannot function.
OS is the first program loaded into memory after booting and the last to close at shutdown.
It is also called a resource manager or master control program.
It runs in kernel mode (privileged), while user apps run in user mode.
Common Examples (memorise the maker)
OS
Made By
Used In
Type
Windows
Microsoft
PCs / Laptops
GUI, Desktop
Linux
Linus Torvalds (open source)
Servers, supercomputers
Open-source, Multi-user
macOS / iOS / iPadOS
Apple
Mac, iPhone, iPad
Unix-based
Android
Google
Smartphones
Linux-kernel based, Mobile
UNIX
Bell Labs
Servers, workstations
Multi-user
MS-DOS
Microsoft
Old PCs
CLI, Single-user
Chrome OS
Google
Chromebooks
Linux-based, Cloud
Exam Tip The most-used desktop OS is Windows; the most-used mobile OS in the world is Android; servers/supercomputers mostly run Linux/Unix. These three facts appear repeatedly.
2 Functions of an Operating System
Function
What it does
Example
Process Management
Creates, schedules & ends running programs
Chrome + Word open together
Memory Management
Allocates & frees RAM for programs
Gives memory to each app
File Management
Stores, names, organises files/folders
Create, copy, delete, rename
Device (I/O) Management
Controls input/output via drivers
Keyboard, printer, mouse
Security & Protection
Controls access & protects data
Passwords, permissions
User Interface
Lets user interact
GUI icons / CLI commands
Error Detection
Finds & reports problems
“Not responding” message
Resource Allocation
Shares CPU, memory & devices fairly
CPU time-sharing
Remember A quick way to recall functions: “PMFDS-URE” → Process, Memory, File, Device, Security, User-interface, Resource-allocation, Error-handling.
3 Components: Kernel & Shell
Kernel The core / heart of the OS. It directly controls hardware, CPU, memory and devices. It always stays in memory.
Shell The interface between the user and the kernel. It takes user commands and passes them to the kernel (e.g. command interpreter in Linux/DOS).
Types of Kernel (frequently asked)
Kernel Type
Idea
Example
Monolithic
Whole OS runs in kernel space; fast but large
Linux, UNIX
Microkernel
Only basics in kernel; services in user space; stable & secure but slower
QNX, Minix, L4
Hybrid
Mix of both
Windows NT, macOS (XNU)
Exam Tip Other key terms: Bootloader (loads OS into memory), Device Driver (software that controls a hardware device), System Call (the way a program requests a service from the OS, e.g. fork(), read(), write()).
4 Types of Operating Systems
Type
Meaning
Example
Batch OS
Similar jobs grouped & run in batches; no user interaction
Old payroll / bank processing
Time-Sharing OS
Many users share CPU using small time slices
Mainframes, Multics
Real-Time OS (RTOS)
Gives output within a strict time limit
Flight control, missiles, ATMs, medical devices
Distributed OS
Many connected computers act as one system
LOCUS, cloud systems
Multi-user OS
Many users use one system together
UNIX, Linux
Multiprocessing OS
Uses two or more CPUs together
Servers, modern PCs
Mobile OS
OS for smartphones/tablets
Android, iOS
Network OS
Manages computers on a network
Windows Server, Novell NetWare
Embedded OS
Runs inside dedicated small devices
VxWorks, washing machines, smart TVs
Common TrapRTOS is the one with guaranteed/immediate response — used in flight control, ATMs and medical equipment. Don’t confuse it with Distributed OS (multiple computers as one).
5 Process Management & Threads
Process A program in execution (a running program). A thread is the smallest unit of execution — a lightweight part of a process.
Process States
NEW → READY → RUNNING → TERMINATED
↑ │
└──────────┘ (back to READY when time slice ends)
RUNNING → WAITING/BLOCKED (for I/O) → READY
PCB (Process Control Block): stores all info about a process (ID, state, registers, priority).
Context switching: CPU saves one process’s state and loads another’s.
fork(): system call used to create a new (child) process.
Daemon: a background process (e.g. antivirus scan, print service).
Multi- terms (very frequently confused)
Term
Meaning
Example
Multitasking
One CPU runs many tasks (by switching fast)
Music + browsing
Multiprocessing
Many CPUs work at the same time
Quad-core processor
Multithreading
Many threads run inside one program
Download + scroll in a browser
Multiprogramming
Many programs kept in memory to keep CPU busy
Improves CPU utilisation
6 CPU Scheduling Algorithms
Scheduling decides which process gets the CPU next. Done by the scheduler; the dispatcher actually hands over the CPU.
Algorithm
Rule
Preemptive?
Key Point
FCFS
First Come First Served
No
Simple; suffers “convoy effect”
SJF
Shortest Job First
No
Lowest average waiting time; risk of starvation
SRTF
Shortest Remaining Time First
Yes
Preemptive version of SJF
Round Robin
Each process gets a fixed time quantum
Yes
Best for time-sharing / interactive systems
Priority
Highest priority runs first
Both
Starvation solved by “aging”
Exam TipPreemptive: Round Robin, SRTF, Preemptive-Priority. Non-preemptive: FCFS, basic SJF. A Gantt chart is used to show scheduling order.
7 Synchronization & Deadlock
Critical Section: code that accesses a shared resource.
Race Condition: output depends on the timing/order of processes accessing shared data.
Mutual Exclusion: only one process uses a resource at a time.
Semaphore / Mutex: tools used to achieve synchronization.
Starvation: a process waits indefinitely for the CPU/resource.
Deadlock A situation where two or more processes wait for each other forever, so none can proceed.
4 Necessary Conditions for Deadlock (Coffman conditions)
Condition
Meaning
Mutual Exclusion
Resource can be used by only one process at a time
Hold and Wait
Process holds one resource & waits for another
No Preemption
Resource cannot be forcibly taken away
Circular Wait
Processes form a circular chain of waiting
Remember All four conditions must hold for a deadlock. Banker’s Algorithm is used for deadlock avoidance.
8 Memory Management
Memory Hierarchy (fast → slow)
Registers → Cache → RAM → SSD → Hard Disk
(fastest, smallest, costliest) ........ (slowest, largest, cheapest)
Cache – very fast memory between CPU and RAM for frequently-used data.
Virtual Memory – uses part of the hard disk as extra RAM (swap / page file).
Paging vs Segmentation
Paging
Memory split into fixed-size pages/frames
Causes internal fragmentation
Uses a page table
Segmentation
Memory split into variable-size logical segments (code, data, stack)
Causes external fragmentation
Matches programmer’s view
Key Memory Terms
Term
Meaning
Page Fault
Required page is not in RAM → must be loaded from disk
Thrashing
Too much paging/swapping → CPU utilisation drops sharply
TLB
Translation Lookaside Buffer — speeds up address translation
MMU
Memory Management Unit — converts virtual→physical address
Demand Paging
Load a page only when it is actually needed
Belady’s Anomaly
More frames → more page faults (occurs in FIFO)
Page Replacement Algorithms
FIFO → removes the oldest loaded page (can show Belady's anomaly)
LRU → removes the Least Recently Used page
Optimal → removes the page not needed for the longest future time
(lowest faults — but only theoretical)
9 File & Device Management
File System Basics
Term
Meaning
File
Named collection of related data
Directory / Folder
Container that stores files
Path
Address of a file (absolute = from root; relative = from current folder)
File Extension
Type of file: .exe, .docx, .txt, .jpg
FAT / NTFS
Windows file systems (NTFS = New Technology File System)