This repository contains important Operating System algorithms implemented in C, covering topics that are commonly taught in UG, PG Computer Science and IT courses.
The main focus of this project is to provide clear, easy-to-understand implementations of OS algorithms such as CPU scheduling, page replacement, and disk scheduling, without unnecessary complexity.
Each program is written to understand how the algorithm works internally, step by step.
operating-system-algorithms-c/
|
|─── CPU-Scheduling/
| ├── fcfs_cpu_scheduling.c
| ├── sjf_cpu_scheduling.c
|
|─── Disk-Scheduling/
| ├── fcfs_disk_scheduling.c
| ├── fcfs_disk_scheduling_head_movement.c
| ├── sstf_disk_scheduling.c
| ├── sstf_disk_scheduling_head_movement.c
|
|─── Disk-Scheduling/
| ├── fifo_page_replacement.c
| ├── lru_page_replacement.c
|
└── README.md
- FCFS (First Come First Serve)
- SJF (Shortest Job First)
These programs calculate scheduling order and basic timing parameters based on process burst times.
- FIFO (First In First Out)
- LRU (Least Recently Used)
These programs simulate memory frames and calculate page faults.
- FCFS Disk Scheduling
- SCAN Disk Scheduling (Simple Version)
- Calculates total seek time only
- SCAN Disk Scheduling (Advanced Version)
- Calculates:
- Total seek time
- Read/write head movement
- Direction changes count
- Calculates:
The advanced version provides a more realistic simulation of disk head movement.
- Language: C
- Compiler: GCC
- Platform: Any (Linux / Windows / macOS)
Navigate to the algorithm folder and use:
gcc filename.c -o output
./outputHarman Singh
This project is licensed under the MIT License — free to use, modify, and share with attribution.