This repository stores CS 3113 operating systems assignments. Each project resides in its own folder so new submissions can be added without disturbing previous work.
PROJECT1/ contains a C++ round-robin process control block (PCB) simulator
that was authored for Project 1. The kernel driver reads a set of processes,
simulates execution using a fixed time quantum of 2, and prints the state of
every PCB after each timer interrupt until all terminate.
PROJECT1/pcb_simulator.cpp– simulator source.PROJECT1/input*.txt– sample inputs that list process counts followed by(pid, workUnits)pairs.PROJECT1/output*.txt– expected output transcripts for the samples.PROJECT1/Project1.pdf– assignment handout.
Use any C++17-capable compiler. Example with g++:
g++ -std=c++17 -O2 -Wall -pedantic -o PROJECT1/pcb_simulator PROJECT1/pcb_simulator.cppOn Windows, add .exe to the output path if you want a native executable:
g++ -std=c++17 -O2 -Wall -pedantic -o PROJECT1/pcb_simulator.exe PROJECT1/pcb_simulator.cppThe simulator reads from standard input. Redirect one of the provided samples or craft your own file that follows the required format:
- First line: number of processes
N. - Next
Nlines:<pid> <workUnits>where each PID is unique andworkUnitsis a positive integer representing total CPU quanta needed.
PROJECT1/pcb_simulator < PROJECT1/input.txtPROJECT1/input.txt:
3
1 6
2 3
3 4
Running the simulator with that input prints the trace stored in
PROJECT1/output.txt, ending with:
Interrupt 7:
PID 1: Terminated, at pc 6
PID 2: Terminated, at pc 3
PID 3: Terminated, at pc 4
All processes completed.
Use the alternate sample pair (input5.txt / output5.txt) to test another
schedule. Refer to Project1.pdf for the full specification and grading
rubric.