- Work
- Mini OS Sim
- Docs
Mini OS Sim
Python CPU scheduler simulator that runs six scheduling algorithms and prints Gantt charts.
1 min read
A small Python simulator of a mini operating system’s CPU scheduler. It demonstrates six scheduling algorithms over the same set of processes and prints a Gantt chart plus turnaround/waiting time stats for each.
Algorithms
- Round Robin (quantum 3)
- Preemptive SJF (Shortest Job First / SRTF)
- Non-Preemptive SJF
- Preemptive Priority
- Non-Preemptive Priority
- First Come First Serve (FCFS)
Requirements
- Python 3.7+ (no external packages)
How to run
Easiest: run script:
./run.sh
Or directly with Python:
python3 scheduler.py
Either way, you’ll be asked whether to enter processes manually or use the built-in sample set, then shown a menu to run any single algorithm or all six at once (g).
Running the tests
python3 test_scheduler.py
Checks every algorithm’s output against a hand-computed 4-process example.
Files
scheduler.py: process model, all six scheduling algorithms, and the interactive menutest_scheduler.py: assert-based self-checkrun.sh: convenience launcher forscheduler.py
Support
Submit issues, questions, or bug reports to the GitHub issue tracker: https://github.com/ADM1SH/cpu-scheduling-simulator/issues
Roadmap
- Done: Core architecture and baseline implementation.
- Done: Functional verification and test coverage.
- To do: Add multi-level feedback queue (MLFQ) algorithm
- To do: Implement memory paging and TLB hit/miss simulation
Contributing
Contributions are welcome.
- Fork the repository.
- Create a feature branch:
git checkout -b feature/improvement. - Commit your changes:
git commit -m "feat: enhance functionality". - Push to the branch:
git push origin feature/improvement. - Open a Pull Request.
Authors and Acknowledgment
- Adam Anwar (ADM1SH) - Lead architect and developer.
- Designed by Adam Anwar for OS scheduling theory and process lifecycle study.
License
Licensed under the MIT License. See LICENSE for details.
Project Status
Completed systems simulation project. Stable and verified.