OS-Scheduler

Build With :

Getting Started

This project is made on a unix-like operating system and this is a list of needed instructions to set up your project locally, to get a local copy up and running follow these instructions.

Installation

  1. Clone the repository
    $ git clone https://github.com/MoazHassan2022/OS-Scheduler.git
  2. Navigate to repository directory
    $ cd OS-Scheduler
  3. Install dependencies
    (Ubuntu)$ sudo apt install build-essential

Running

  1. Compile the OS Scheduler
    $ make
  2. Run the OS Scheduler
    $ make run
  3. Generate new processes information to processes.txt (Our input file)
    $ gcc test_generator.c -o test_generator.out
    $ ./test_generator.out

Project Structure

OS-Scheduler
├── algorithms.h
├── bud.h
├── commons.h
├── headers.h
├── priority_queue.h
├── queue.h
├── vector.h
├── keyFile
├── MakeFile
├── memory.log
├── scheduler.log
├── scheduler.pref
├── clk.c
├── prgenerator.c
├── process.c
├── process_generator.c
├── scheduler.c
├── test_generator.c
├── processes.txt
  

Description

This project was implemented in C language for Operating Systems course in Cairo University, Faculty of Engineering, Commputer Engineering Department.
It is a a processes scheduler with limited memory (1024 Byte) that takes inputs from processes.txt file that has these columns for every process:

  1. id.

  2. arrival.

  3. runtime(Burst time).

  4. priority.

  5. memorysize.

Note that every process can have less than or equals 256 byte memory size.
Then the scheduler simulates running these processes with one of three algorithms that the user can choose:
  1. Heighst Priority First(Non-Preemptive and heighst priority process with least priority number).

  2. Shortest Remaining Time Next.

  3. Round Robin(User chooses the quantum).

Then outputs details about scheduling scenarios to scheduler.log file that has this details for every process:
# At time x process y state arr w total z remain j wait k
And details about CPU utilization, Avg Weighted Turnaround Time, Avg Waiting Time and standered deviation of Weighted Turnaround Time to scheduler.pref.
And finally details about memory allocating and deallocating to memory.log that has this details for every process:
# At time x allocated(Or deallocated) y bytes for Processs z from i to j