CS 300: Operating Systems

This is an implementation of a simulated process scheduler that communicates with a simulated hard drive disk.

Features

  • Process.c
  • Scheduler.c
  • Disk.c

Process.c

This file generates "processes," simulated by structs. They represent processes in an operating system and are used by the Scheduler and Disk to demonstrate functionality.

NOTE: Must be compiled with "utils.c" and "utils.h"

Scheduler.c

This file simulates a process scheduler within an operating system. After (1) generating processes, the Scheduler then (2) assigns priority to each one and stages the processes for running via placement in a series of queues, then (3) finally runs the processes in order. The Scheduler accounts for blocking and for other issues.

Disk.c

This file simulates a disk. It receives disk requests from the Scheduler and processes them, then returns the desired data. In order to simulate a rotating disk, it returns data in an alternating order of largest to smallest, then smallest to largest, etc.

FIFO

Process communication between the Scheduler and Disk is handled using FIFO.

Testing

In two separate terminals, run the following commands (in the given order):

In Terminal 1: gcc newDisk.c -o disk

In Terminal 2: gcc Scheduler.c utils.c utils.h Process.c ./a.out

In Terminal 1: ```./disk````

Notes from study sessions

board2 board1