Coder Social home page Coder Social logo

modified-xv-6's Introduction

MODIFICATION TO XV6 OPERATING SYSTEM ASSIGNMENT 5

OVERVIEW In this assignment we have made various implementations and changes to xv6 operating system.We have implemented new system calls such as waitx,ps etc .Various scheduling algorithms such as FCFS,PBS,MLFQ have also been implemented.

• For implementing a new system calls changes in following files is required-
  1.user.h
 2.usys.S
 3.syscall.h
 4.syscall.c
 5.sysproc.c
 6.defs.h
 7.proc.c
 8.proc.h

WAITX SYSCALL This new system call is added to proc.c function which works similarly as wait function but also returns the wait time and run time of a process.New parameters are added in proc structure such as wait_time,run_time,start_time,end_time . Therefore waitx system call returns the wait time and run time of a process.User program to test this is time.c and we can test it using time .

SCHEDULER FUNCTIONS

1.FCFS – In this scheduling algorithm whichever process comes first is executed first . It is a non preemptive and in this we iterate over all the processes and check for their start time and select with least starting time.

2.PBS – In this scheduling algorithm we select process with highest prioirty (with lowest priority number ) and if two processes have same priority then processes are selected in round robin fashion.We also check that if a process is running and a process with higher priority comes then currently running process is preempted and replaced with higher priority process.

3.MLFQ – In this scheduling algorithm we have assigned time_slice for each queue as 1,2 ,4,8,16 for q0,q1,q2,q3,q4 respectively.We select process from highest priority queue which is non-empty . Also to avoid starvation aging is done with age of 20 . After every age time a process moves to a higher priority queue.After completing time slice priority of process is decreased and it is moved in lower priority queues .

We can test these scheduler functions by using SCHEDULER=(FCFS/PBS/MLFQ) SET_PRIORITY SYSCALL This new system call is added to proc.c function to change the priority of a process for PBS scheduler .We can change the priority of a process ranging from [0,100] . This system call returns the old priority of a process.We can test this using setPriority new_piority pid command.

PS This new system call is added to proc.c function to extract the information for each process.We can test this using ps command.

BONUS(graph) Graphs are made for five processes which depicts the queue number of process with the number of ticks. Observations for different processes: For the process that are more cpu bound remain in lower queues and with more io bound remain in higher level queues(queues with low prioirty) as they don’t require much cpu time.

modified-xv-6's People

Contributors

shivanggupta2309 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.