Marquette University logo      

 

 

NOW DUE FRIDAY, March 8, 5:00 P.M.

Dennis writes: Human TA Patrick will be mailing out corrections for one of the xinu-hw6 files shortly -- this correction impacts your ability to correctly implement aging *without* preemption, as called for in the assignment. Several of you independently discovered this problem and showed it to me last night, or early this morning. There will also be a revised xinu-hw6.tgz tarball for (God forbid) anyone who has not started yet.

Given this late stage change to the assignment code, we're going to push the deadline for Project 6 back two days, to allow more time for everyone to make the corrections and get everything working. This will also permit several more nights of TA-Bot runs.

The new deadline for Project 6 is this Friday, at 5pm.

TA Patrick writes: We are issuing a patch (in the form of a traditional patch file) for "system/clkinit.c" in xinu-hw6. This patch will enable your ability to properly implement aging without preemption. To run this patch, first navigate inside your xinu-hw6 directory. To confirm you're in the right path, you can run the command pwd to print your current working directory, which should end in /xinu-hw6. Finally, to apply the patch, run this command:

        patch -p0 < ~brylow/os/Projects/hw6-clkinit.patch
Then, you should see "patching file system/clkinit.c". Patch complete.

Also, as Dr. Brylow stated in his previous email to you, there will be a revised xinu-hw6 tarball for anyone that has yet to even untar these assignment files.

If you have any problems/questions, please email one of the TA's.

 

Submit: Turn in your source code using the turnin command on the lab machines. Submit your entire xinu-hw6 directory for this assignment.

Work should be completed in pairs. Be certain to include both names in the comment block at the top of all source code files. It would be courteous to confirm with your partner when submitting the assignment.

Preparation

First, make a copy of your Project 5 directory:
      cp -R xinu-hw5 xinu-hw6
Then, untar the new project files on top of it:
      tar xvzf ~brylow/os/Projects/xinu-hw6.tgz

Be certain to make clean before compiling for the first time.

Round-robin Priority Scheduling

You will use three round-robin priority queues (one each for "low", "medium", and "high" priority) to add priority scheduling to your operating system. Three priority queues times four cores equals 12 total queues.

This priority scheduler can be implemented in three easy steps:

  1. Add a priority field called "priority" into PCB structure defined in include/proc.h.
  2. Add priority parameter to create(), and properly initialize the priority field in each new PCB created.
  3. Modify the ready() and resched() functions to properly use the three priority queues. See corresponding TODO comments in ready.c and resched.c for details.

New test cases are in system/testcases.c, which should demonstrate priority-order execution once your new scheduler is operational. You will need to create others to fully test your implementation.

Starvation and Aging

One of the chief drawbacks to simple priority scheduling is that low priority processes may be starved by high priority processes. That is, they may never get to run at all. One remedy for this it to implement aging, a scheme in which the effective priority of a process increases the longer it sits in the ready list without running.

We've added a kernel configuration parameter "AGING" into include/kernel.h. Add code into resched.c so that when AGING is TRUE, available processes are moved, or "promoted", to a higher priority queue when certain time conditions are met (see TODOs in resched() and definitions in include/clock.h).

Construct a test case that demonstrates process starvation when AGING is FALSE, but demonstrates aging when AGING is set to TRUE. Put your aging test case in testcases.c, and make it run when the input is 'A'.

Preemption

The new files system/clk* will provide you with basic preemption, as discussed in class. Take time to familiarize yourself with the contents of these files, as you will be responsible for understanding how these components of the operating system work.

Activate preemption by changing the PREEMPT constant in include/kernel.h to TRUE. How can you test that preemption is working in your system? Create a test case that demonstrates preemptive scheduling. Put your preemption test case in testcases.c, and make it run when the input is 'P'.

Notes

  • To submit your project, please run "make clean" in your compile directory, change directory back two levels, and submit the entire system with the command turnin xinu-hw6. You can verify what you have submitted using turnin -v.
  • To complete this assignment, you will have made changes to several header files in the include/ directory, and many .c files in the system/ directory.

 

 

 
  Marquette University. Be The Difference. Marquette | Corliss |