Homework 3 -- Programming


This is a group assignment, per the instructions given at the beginning of the semester. Turn in one copy of the programming assignment; however, each of you must turn in individual written assignments.

In addition, each team member must turn in the group programming evaluation with their own written assignments.


You're going to be modifying a kernel. We do not want you to submit an entire kernel source tree; instead, you'll submit the output of "diff" -- the differences between your code and the original. You'll also need to submit a working or a non-working cover sheet. Finally, turn in any test programs or data, a README file documenting your work (including clear explanations of what each file is), and output from test runs.

Fair Share Scheduling

(90 points) The assignment is to add a fair share scheduler to the kernel.

As discussed in class, there are several classes of scheduling available for Linux. Add a new one that does fair-share scheduling, based on uid. There will be a weight W associated with each fair share group; this value is set by a system call. (Actually, you'll need two system calls, getgroupweight() and setgroupweight(). Both take a uid as a paramter; the second takes a weight as well.)

The weight is used as a multipler for the quantum, rather than as a priority modifier. This multiplier applies to all processes owned by that user.

For simplicity's sake, you may have a fixed-size array mapping uids to weights. The size of this array should be a #define; all references to the array size must reference the defined name. The only reason for this simplification is so that you don't have to worry about dynamic storage allocation in the kernel.

Your vmware directory is not backed up. For safety's sake, make a copy of your changes — not the whole kernel tree! — on another machine.

Danger, Will Robinson

If two people boot the same virtual machine at the same time, it will corrupt the (virtual) disk. Please co-ordinate usage with other members of your team.