PROCESS STATES
1. New
Process is being created and loaded into memory.
➡ Goes to Ready
2. Ready
Process is ready and waiting for CPU in the ready queue.
➡ CPU assigned → Running
3. Running
Process instructions are being executed by CPU.
May move to:
● Ready → Interrupt / time slice over
● Waiting → I/O request
● Terminated → Execution finished
4. Waiting (Blocked)
Process is waiting for I/O or an event.
➡ I/O complete → Ready
5. Terminated
Process has finished execution and is removed from memory.
Information Stored in PCB
1️⃣ Process State
● New, Ready, Running, Waiting, Terminated
2️⃣ Program Counter (PC)
● Address of the next instruction to execute
3️⃣ CPU Registers
● Accumulator, Index registers, Stack pointer, General-purpose registers
● Needed to continue execution correctly
4️⃣ CPU Scheduling Information
● Process priority
● Pointers to scheduling queues
5️⃣ Memory Management Information
● Base and limit registers
● Page table or segment table details
6️⃣ Accounting Information
● CPU time used
● Process ID, job number, time limits
7️⃣ I/O Status Information
● List of open files
● I/O devices allocated
🔁 Role of PCB in Context Switching
During a context switch:
1. OS saves current process data into its PCB
2. OS loads another process’s PCB
3. That process resumes from where it stopped
➡ PCB makes multitasking possible