The Role of an Operating System
An Operating System (OS) is system software that acts as an intermediary between computer hardware and user applications. It manages system resources (CPU, memory, storage devices, and I/O peripherals) and provides a secure, convenient environment for software execution.
1. Process Management and Process States
A process is an active program currently in execution. During its lifecycle, a process transitions through various states:
- New: The process is being created and loaded into memory.
- Ready: The process is in main memory waiting to be allocated CPU execution time.
- Running: Instructions are currently being executed by the processor.
- Waiting / Blocked: The process is waiting for an event or I/O operation to complete.
- Terminated: The process has finished execution and its allocated resources are released.
2. CPU Scheduling Algorithms
When multiple processes are ready, the OS CPU scheduler selects which process should execute:
First-Come, First-Served (FCFS)
Processes are executed in the exact order they arrive in the ready queue. While simple to implement, FCFS suffers from the "Convoy Effect," where short processes wait behind long-running processes, increasing average waiting time.
Round Robin (RR) Scheduling
A preemptive scheduling algorithm designed for time-sharing systems. Each process is allocated a fixed slice of CPU time called a time quantum. If the process does not complete within its quantum, it is preempted and returned to the back of the ready queue.
3. Memory Management: Paging and Virtual Memory
Because physical RAM is limited and expensive, operating systems use memory management techniques to allow programs larger than physical memory to execute:
- Paging: Physical memory is divided into fixed-size blocks called frames, and logical memory is divided into identical-sized blocks called pages. This eliminates external fragmentation.
- Virtual Memory: Combines physical RAM with secondary storage (hard drive / SSD swap space), giving the illusion of a virtually unlimited memory address space.
.webp)



