NBC 101 • Unit 316 min read★ Very High Exam Frequency
Operating System Core Functions & Process Lifecycle Management
Unit 3: Computer Software, Translators & Operating Systems • Fundamentals of Computer
👨🏫 Professor's Mental Model: The University Campus Administrator & Traffic Controller
Operating System college ke Principal aur Administrative Controller jaisa hai: Har student (Process) ko classroom (RAM memory), professor ka time (CPU execution), aur library books (Files) allocate karta hai taaki koi doosre ke kaam me rukawat na daale aur poora campus smoothly chale!
Operating System 5-State Process Lifecycle Simulator
Interactive simulation of CPU Scheduling transitions, I/O blocking, Time-Slice interrupts, and Process Control Block (PCB) states.
1. CREATIONNEWOn Secondary Disk
2. IN RAM QUEUEREADYAwaiting CPU Time
3. CPU EXECUTIONRUNNINGExecuting on Core
4. I/O WAITWAITINGBlocked on I/O
5. EXITTERMINATEDFreed from RAM
Trigger OS Scheduler & Hardware Interrupt Events:
OS Kernel Log:Process initialized in READY queue with PID 4182.
Process Control Block (PCB) in Kernel Space (PID: 4182):
Process State:READY
Program Counter (PC):0x0040108E
CPU Cycles Used:142 Cycles
Memory Allocated:0x7FFF00 - 0x7FFFFF (1 MB)
1. The 5 Core Functions of an Operating System
1. Processor Management (CPU Scheduling): Allocates CPU core execution time to concurrent processes using scheduling algorithms (FCFS, Round Robin, Shortest Job First - SJF).
2. Memory Management: Tracks every byte of primary RAM. Dynamically allocates memory blocks to new processes and reclaims addresses upon process termination (Paging, Segmentation, Virtual Memory).
3. File System Management: Organizes files into hierarchical folder structures, manages access permissions, and handles storage allocation tables (NTFS, ext4, FAT32).
4. Device (I/O) Management: Coordinates device drivers, buffers data streams, and manages Spooling (Simultaneous Peripheral Operations On-Line — e.g., Print Spooler queue).
5. Security & Protection: Enforces user authentication, password encryption, access control lists (ACL), and process memory isolation.
2. The 5-State Process Lifecycle Architecture
A Process is a program in active execution. It transitions through 5 fundamental states:
1. New: The process is being created and loaded from secondary disk into RAM.
2. Ready: The process is residing in RAM ready queue, waiting for the OS CPU Scheduler to assign processor time.
3. Running: Instructions are actively executing on the CPU core.
4. Waiting (Blocked): The process cannot execute until an external I/O event completes (e.g., waiting for keyboard input or disk read).
5. Terminated: The process finishes execution (exit syscall), and OS reclaims all allocated memory and resources.
3. Process Control Block (PCB) Structure
The OS kernel maintains a dedicated data structure called the PCB (Task Control Block) for every active process containing:
• Process ID (PID)
• Process State (New, Ready, Running, Waiting, Terminated)
• Program Counter (PC - Address of next instruction)
• CPU Registers & Accumulator state
• Memory Management Information (Base and Limit registers)
• Accounting & CPU Scheduling Priority
• List of Open I/O Files and Sockets
5 Process States & State Transition Triggers
| State Transition | From State | To State | Triggering Event |
|---|---|---|---|
| Admit | New | Ready | OS allocates PCB and loads process into RAM Ready Queue |
| Scheduler Dispatch | Ready | Running | CPU Scheduler selects process and assigns CPU core |
| Interrupt / Timeout | Running | Ready | Time Quantum expires in Time-Sharing OS (Timer Interrupt) |
| I/O or Event Wait | Running | Waiting | Process requests I/O operation (Disk read / Network call) |
| I/O Complete | Waiting | Ready | I/O hardware completes operation and generates hardware interrupt |
| Exit | Running | Terminated | Process executes return / exit() system call |
🎯 University Exam Scoring Blueprint
- Draw the 5-State Process Lifecycle Diagram (New -> Ready -> Running -> Waiting -> Terminated) with directional transition arrows.
- List the 5 primary functions of an Operating System with brief explanations.
- List the 6 key fields inside a Process Control Block (PCB).
Top Viva Questions on Operating System Core Functions & Process Lifecycle Management
1