CS 1651: Advanced Operating Systems
Programming Assignment #2: EDF Scheduling
Due Date: Friday, Feb 23, 2004, 3pm
Description
For this assignment, you will design an EDF scheduler and use it to
replace the original scheduler of the Operating System you have
installed in your machine for assignment 1.
You need to provide two system calls:
- RT_fork
(p, e), to create a process with period p, and
worst-case execution time e. This is
a function similar to fork(). If period p is not
specified (p=0),
it should be treated as an aperiodic task (no deadline).
Extra credit: RT_fork (p, e, d),
where the deadline may be different from the period. If period p is not
specified (p=0),
it should be treated as an aperiodic task (with a deadline); If
deadline d
is not specified (d=0), it
should be treated as non-RT task (no deadline). You'll have to
give a lot of thought to this one, it's not easy!!
- RT_kill
(pid), to kill a process. Since we are dealing with periodic
tasks, you should treat this function differently from exit() call,
which means this function will only end the execution of one task, not
the process that run tasks periodically.
The EDF scheduler must satisfy following requirement:
- If some processes have different deadlines, they should be
scheduled with Earliest Deadline First algorithm.
- If all processes have the same deadline, they should be scheduled
with the algorithm of the original scheduler (you can let the original
scheduler to do the job).
- Maintain a timer to start new tasks at every period.
- Upon exiting a task, set the timer to start the task when next
period comes. (Hint: you need to reset stack, program counter, etc. to
make sure the task will start executing the next instance from
beginning.)
- If a task is going to miss its deadline (that is, the task
executes--for some reason--more than it's worst-case, report the WCET
and the remaining execution time of that task.
- Extra credit: Maintain
a state of the task intact from one instance to another. To test
your program, your application can keen a sequence number (1,2,3,...)
and output this number each instance the task is scheduled.
Applications (the tasks)
You need to devise or obtain applictions (tasks) to test your system.
To make the project interesting, you could use video clips, graphics,
or 3D rendering (you will be required to demo your system). For you own
testing, you can create your own applications. These tasks will
be run periodically as described early.
Testing
Testing will include two parts.
- You will show your scheduler works with the application you
devised.
- Your system will be overloaded by the grader with other processes
(with/without deadline constraints) and performance of your RT
application will be compared when system is overloaded and not
overloaded..
What to submit?
You must submit your source code (your new kernel files, your
applications, etc) and a readme file explaining your design decisions
and detailed instructions for testing. You are required to make
appointments to demostrate your system.