edit · history · print

Due 10/6/06.

Start with the stripped version of the standard 2.6 scheduler:

    http://www.oslab.info/uploads/Labs/sched.c.txt

(sorry about the .txt endings on everything - it's because of the wiki we are using)

Make the following modifications to isolate all scheduler-specific code:

1. 'struct runqueue' - Take active, expired, and arrays[] out

   of this structure and put them into one called struct runqueue_ingo,
   then replace them with:
       struct runqueue_ingo ingo;
   Put them into runqueue_ingo and put it in the file sched-ingo.h

Get the code to compile and run. You may want to use the following trick:

  put a '_' in front of each field in runqueue_ingo
     (i.e. _active, _expired)

  define the old names to be ingo._name:

    #define active  ingo._active
    #define expired ingo._expired

NOTE - you might wish to skip this, as it will cause more trouble for the rest of the assignment than it avoids here

2. Modify schedule() around line 1194 (switch_tasks:) to call a new function that determines the next task:

           next = get_next_task(rq, now)

   In particular, this will replace all the code from
        idx = sched_find_first_bit(...
   up through the label switch_tasks:.

Get this version to compile and run.

3. Remove all the code in sched_setscheduler and replace it with 'return 0'. Move get_next_task, activate_task, deactivate_task, resched_task, and schedule_tick to the file sched-ingo.c, along with all the functions they call.

Get it to compile and run.

Check that you can boot and run a kernel compile on the new kernel.

edit · history · print
Page last modified on October 13, 2006, at 08:06 AM EST