MiniOS is a simulation of an operating system process scheduler with memory management using the buddy system. It supports three scheduling algorithms:
- Non-preemptive Highest Priority First (HPF)
- Shortest Remaining Time Next (SRTN)
- Round Robin (RR)
The project demonstrates inter-process communication using message queues, process synchronization with semaphores, and shared memory for process control blocks. It also logs process and memory events for analysis.
- Process Generator: Reads process data and starts the simulation at the correct simulated time through
make run. - Scheduler: Receives processes, schedules them according to the selected algorithm, manages memory allocation using the buddy system, and logs events.
- Memory Management: Implements the buddy system for dynamic memory allocation and deallocation.
- Logging: Generates
scheduler.log,memory.log, andscheduler.perffor process and memory events and performance statistics.
- GCC (tested with gcc on Linux)
- Make
- POSIX-compliant system (Linux terminal is required)
- Standard C libraries
⚠️ This project is meant to be compiled and run on a Linux system using a Linux terminal to access system libraries like message queues, semaphores, and shared memory.
-
Clone the repository:
git clone <repo-url> cd MiniOS-New
-
Build the project:
make
This will compile all binaries into the
bindirectory.
-
Run the simulation:
make run
- The process generator will start automatically and prompt you to:
- Choose the scheduling algorithm (HPF, SRTN, RR).
- If RR is selected, enter the quantum value.
- The process generator will start automatically and prompt you to:
-
View Output:
scheduler.log: Logs process state changes (start, stop, resume, finish).memory.log: Logs memory allocation and deallocation events.scheduler.perf: Contains performance statistics (CPU utilization, average WTA, waiting time, standard deviation).
src: Source code filesinclude: Header filesmodels: Data structure definitionsbin: Compiled binariesprocesses.txt: Input file for processes (generated)scheduler.log,memory.log,scheduler.perf: Output logs
To remove binaries and output files:
make cleanFor more details, see the comments in each source file.