Process & PCB Concept
- Basic Computer Organization
- What is RAM and CPU?
Introduction
Operating System ko simple language me samjho. Jab tum mobile chalate ho aur WhatsApp aur YouTube ek sath open karte ho, tab jo system background me decide karta hai ki kis app ko CPU kitni der milegi, usse Operating System kehte hain. Program on disk is just dead code, par jab wo memory me load hokar CPU par execute hone lagta hai, toh use hum Process kehte hain.
Real-Life Analogy
💡 Restaurant Kitchen Analogy
Kitchen counter, Chef and Cooking Process
| Concept Term | Real-life Analogy Mapping |
|---|---|
| CPU | Kitchen Chef (jo actually kaam karta hai) |
| Process | Customer's Food Order (jo execute hona hai) |
| Ready Queue | Kitchen counter jahan orders queue me lagte hain |
| Execution | Chef cooking the food |
| Waiting State | Chef waiting for raw ingredients from storehouse |
Detailed Concept Explanation
Ek process computer memory (RAM) me layout hota hai. Iske 4 primary parts hote hain: 1. **Text Section**: Jisme compile kiya hua machine code hota. 2. **Data Section**: Global and static variables store hote hain. 3. **Heap Section**: Dynamic memory allocation (like malloc in C) ke liye. 4. **Stack Section**: Local variables, return parameters, aur function calls store karne ke liye. Har process ke data ko manage karne ke liye OS ek block banata hai jise **Process Control Block (PCB)** bolte hain. PCB me Process State, PC (Program Counter), CPU Registers, CPU Scheduling Info, Memory Management Info, aur I/O Status save rehta hai.
Visual Diagram
- Program disk par physical state me hota hai (Passive Entity), jabki Process RAM me active running state me hota hai (Active Entity).
- Program Counter (PC) store karta hai agle instructions ka address jo execute hona hai.
- PCB is stored in Kernel space of Memory.
P-P-S-A-M-I (Pappu Pyare Soja, Aise Mat Itra)
Process state, Program counter, Stack pointer, Allocations (resources), Memory limits, I/O list
Practice Mini Quiz
Revision Summary (One-Page Notes)
- •Process is a program in execution.
- •It is represented in the OS by PCB.
- •PCB contains ID, state, counter, registers, etc.
- •States include New, Ready, Running, Waiting, Terminated.
- •Transition is controlled by Schedulers.