Skip to content

messi-b11/CS3113_OS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

CS3113 Operating Systems Projects

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 – Round-Robin PCB Simulator

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.

Layout

  • 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.

Build

Use any C++17-capable compiler. Example with g++:

g++ -std=c++17 -O2 -Wall -pedantic -o PROJECT1/pcb_simulator PROJECT1/pcb_simulator.cpp

On 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.cpp

Run

The simulator reads from standard input. Redirect one of the provided samples or craft your own file that follows the required format:

  1. First line: number of processes N.
  2. Next N lines: <pid> <workUnits> where each PID is unique and workUnits is a positive integer representing total CPU quanta needed.
PROJECT1/pcb_simulator < PROJECT1/input.txt

Sample

PROJECT1/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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages