A comprehensive C-based simulator suite that implements, analyzes, and visualizes core Operating System algorithms. It provides an experimental playground to explore performance trade-offs across the three pillars of OS management — CPU Scheduling, Memory Management, and Disk Scheduling.
This project is divided into three self-contained modules, each representing a key domain of OS design.
Simulates how processes are assigned to the CPU, optimizing throughput, waiting time, and response time. It uses randomized process data to model dynamic workloads.
| Algorithm | Type | Description |
|---|---|---|
| First-Come, First-Served (FCFS) | Non-Preemptive | Executes processes strictly in order of arrival. |
| Shortest Job First (SJF) | Non-Preemptive | Chooses the process with the smallest burst time. |
| Shortest Remaining Time First (SRTF) | Preemptive | Preemptive SJF — switches if a new process has shorter remaining time. |
| Round Robin (RR) | Preemptive | Uses a fixed time quantum for each process in a cyclic queue. |
| Multilevel Feedback Queue (MLFQ) | Preemptive | Uses multiple queues with dynamic priorities and variable time slices. |
📊 Key Metric: Average Turnaround Time & Average Waiting Time
Models virtual memory paging, simulating how pages are replaced in physical RAM to minimize page faults.
| Algorithm | Description |
|---|---|
| First-In, First-Out (FIFO) | Replaces the oldest loaded page. |
| Least Recently Used (LRU) | Replaces the page least recently referenced. |
| Optimal (OPT) | Theoretical best — replaces the page not used for the longest future duration. |
📊 Key Metric: Total Page Faults
Simulates disk head movement for various I/O request scheduling algorithms to minimize seek time and head movement.
| Algorithm | Description |
|---|---|
| First-Come, First-Served (FCFS) | Processes requests in the order they arrive. |
| Shortest Seek Time First (SSTF) | Serves the nearest request to the current head. |
| SCAN (Elevator Algorithm) | Moves in one direction servicing all requests, then reverses. |
| C-SCAN (Circular SCAN) | Like SCAN, but jumps to the start after reaching the end. |
| LOOK & C-LOOK | Optimized versions that travel only as far as needed. |
📊 Key Metric: Total Head Movement
- A C compiler (e.g.,
gcc) - git for cloning the repository
git clone https://github.com/HarshithSuda/CPU-Scheduling-Algorithms.git
cd CPU-Scheduling-AlgorithmsEach module is implemented in a separate C file. You can compile and run any simulator independently:
# Example: Disk Scheduling
gcc Disk_Scheduling.c -o disk_sim
# Example: Round Robin CPU Scheduling
gcc Round_Robin.c -o rr_sim./disk_simThe program outputs performance metrics (like average waiting time or total head movement) directly to the terminal.
--- Disk Scheduling Simulation ---
Order of Access: 98 → 183 → 37 → 122 → 14 → 124
Total Head Movement: 208 Cylinders
- Understand the core mechanisms behind OS resource management.
- Compare algorithmic performance metrics through direct simulation.
- Gain hands-on experience with CPU scheduling, memory paging, and disk optimization logic.
- 🔍 Add visual graphs for CPU Gantt charts.
- 🧩 Integrate interactive CLI menus.
- 🧠 Extend with process synchronization (Semaphores, Deadlocks).
Harshith Suda 🎓 B.Tech, NIT Andhra Pradesh 💼 Passionate about Operating Systems, Algorithms, and System Design