Os Complete Notes
Os Complete Notes
Process Management Process, PCB, States Scheduling Algorithms (FCFS, SJF, Round
Robin, Priority) Threads & Multithreading Inter-Process Communication (IPC)
Deadlocks Conditions, Prevention, Avoidance (Banker’s), Detection, Recovery
Memory Management Paging, Segmentation Virtual Memory, Page Replacement
(FIFO, LRU, Optimal) File System File Allocation (Contiguous, Linked, Indexed)
Directory Structure Disk Scheduling Algorithms FCFS, SSTF, SCAN, C-SCAN I/O
Management System Calls Synchronization Critical Section, Semaphores, Mutex
🔸 Example: When you open MS Word, the OS loads it and starts its
execution.
🔸 Example: If two apps are open, OS decides how much CPU each
gets.
Debuggers – gdb
📘 Diagram:
sql Copy Edit New → Ready → Running → Terminated
↓↑
Waiting ← 📋 Process Control Block (PCB) Each process is represented by a PCB,
which stores information about the process.
CPU Registers
OS will:
Save A's current state in its PCB Load B's state from its PCB Give CPU to B This is
called context switch.
Memory information
🔁 Parent and Child Processes The process that creates another is called the Parent.
A process can have one or more threads. All threads in the same process share the
same memory and resources.
🔸 Example: When you open a web browser: One thread loads the
page One thread handles user clicks One thread plays video
All these threads work together in the same process.
Semaphores
Locks To avoid conflicts.
👥 Types of Threads
User-Level Threads (ULT) Managed by the user (not the OS).
🔸 Example: Two threads politely step aside for each other again
and again — but never proceed.
✅ Fair to all, but may have high waiting time if quantum is too
small
↓ ↑
Waiting ←———————————
Comparison: CPU Scheduling Algorithms
Algorithm Type Preemption Notes
FCFS Non-preemptive No Runs in order of
arrival
SJF Both Optional Runs shortest job
first
Priority Both Optional Higher priority runs
first
Round Robin Preemptive Yes Each gets a time
slice
Multilevel Queue Both Depends Different queues for
process types
Multilevel Feedback Preemptive Yes Processes can move
between queues