Skip to content

A CPU scheduler determines an order for the execution of its scheduled processes. using three algorithms Non-preemptive Highest Priority First (HPF) Shortest Remaining time Next (SRTN) & Round Robin (RR) and include memory allocation capabilities using the buddy memory allocation system

License

Notifications You must be signed in to change notification settings

Abd-ELrahmanHamza/OScheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OScheduler

contributors license forks stars issues

An Operating systems scheduler

Description

Phase 1

  • A CPU scheduler determines an order for the execution of its scheduled processes.
  • Computer with 1-CPU and infnite memory. It is required to make a scheduler with its complementary components as sketched in the following diagrams.

digram

Process generator

  • Read the processes to schedule from input file
  • Ask the user for the chosen scheduling algorithm (and its parameters in case of Round Robin (RR) which is the quantum)
  • Initiate and create the scheduler and clock processes.
  • Send process information to the scheduler when it arrives

Clock

  • The clock module is used to emulate an integer time clock.

Scheduler

  • It keeps track of the processes and their states and it decides - based on the used algorithm - which process will run and for how long.

  • Algorithms used: -

    1. Non-preemptive Highest Priority First (HPF).
    2. Shortest Remaining time Next (SRTN).
    3. Round Robin (RR).

Process

  • Each process should act as if it is CPU-bound.

Input/Output

  • Input File

inputFile

  • Output File
    • Record state of processes : started, resumed, stopped, finished.
    • TA (Turnaround time) & WTA(Weighted turnaround time) are written only at finished state.

outputFile

  • Scheduler.pref Contains
    • CPU utilization
    • Average turnaround time
    • Average weighted turnaround time
    • Standard deviation of weighted turnaround time

Phase 2

  • Scheduler is modified to include memory allocation capabilities using the buddy memory allocation system. It should allocate memory space for processes as they enter the system and free it as they leave so that it can be re-used by later processes.
  • The total memory size is 1024 bytes.

Input file edit

inputFile2

Memorylog

memorylog

Getting Started

Dependencies

  • Platform: Linux
  • Language: C

Installing

git clone https://github.com/Abd-ELrahmanHamza/OScheduler

Executing program

  • Direct to the folder of phase1 ot phase2
  • Open terminal
  • Build project using
make
  • Or build it using
make build
  • Generate test cases
./test_generator.out
  • Enter number of processes to be generated
  • Run it using
make run
  • Select algorithm

    1 for Non-preemptive Highest Priority First (HPF).

    2 for Shortest Remaining time Next (SRTN)

    3 for Round Robin (RR).

  • In case of round robin enter the quantum

Contributors

Abdelrahman Hamza
Abdelrahman Hamza

Ziad Sherif
Beshoy Morad

Zeyad Tarek
Zeyad Tarek

Ziad Sherif
Ziad Sherif

License

This project is licensed under the [MIT] License - see the LICENSE.md file for details

About

A CPU scheduler determines an order for the execution of its scheduled processes. using three algorithms Non-preemptive Highest Priority First (HPF) Shortest Remaining time Next (SRTN) & Round Robin (RR) and include memory allocation capabilities using the buddy memory allocation system

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published