What is an Operating System?
Software that manages hardware and runs programs
Main goal of OS
Efficient resource management
Kernel
Core part of operating system
User mode
Restricted execution mode
Kernel mode
Full hardware access mode
Process
Program in execution
Thread
Smallest execution unit inside process
Process vs Thread
Process heavy thread lightweight
PCB
Process Control Block
PCB stores
PID state registers memory info
Context switching
CPU switching between processes
Scheduler
Selects next process
Long-term scheduler
Admits jobs to memory
Short-term scheduler
Chooses next CPU process
Dispatcher
Gives CPU to selected process
Ready state
Waiting for CPU
Running state
Executing on CPU
Blocked state
Waiting for I/O
CPU scheduling
Selecting next process
FCFS
First come first served
FCFS problem
Convoy effect
SJF
Shortest job first
SJF advantage
Minimum waiting time
Priority scheduling
Higher priority first