Project 2: Process
Scheduling in Linux
For this project, you will implement a round robin scheduler in the Linux
kernel that you can select using a modified system call. You will also add
a new system call to set the default timeslice in your new scheduler. You
are allowed to work in groups of 2. Each group will also submit a short
report describing their implementation. Other details are in the handout
Submission Due: April 28, 11:59pm
The starter code is available here. You should download the starter
code from this web-site and transfer the files to your KVM image.
- Project Description
- Starter Kernel
- Kernel Configuration File
- Kernel Build Script
- Kernel (Re-)install Script
- .vimrc for Editing the Kernel
You will use the KVM setup described in the lab to build and test your
project. You can use the image you created in lab earlier this semester.
You will need to manually transfer the files listed above to your KVM.
The kernel configuration file should be located in /configs/kvm-kernel.config. The source code for the
thread_runner program is provided (thread_runner).
Additionally, we have provided scripts for building
installing (/bin/reinstall-kernel) the kernel
for this project. Finally, we are including a customized dot_vimrc file
(/root/.vimrc) for editing code with the kernel
You should review the KVM
lab for information on how to build and install kernels on your image.
When you have completed your project, you will submit your report as well as
a patch file with your implementation to the TA's email account.
Follow these instructions to generate your patch file:
- Log into your KVM and create a directory to hold the original kernel
we distribute with this assignment and cd into this directory:
mjantz@eecs678-kvm:~$ mkdir orig
mjantz@eecs678-kvm:~$ cd orig/
- Copy the kernel tar file we distribute for this assignment to this
directory. You can download the original kernel source from within your
KVM by doing:
mjantz@eecs678-kvm:~/orig$ wget http://www.ittc.ku.edu/~kulkarni/teaching/EECS678/projects/scheduling/materials/linux-188.8.131.52.tar.gz
- Untar the original kernel source:
mjantz@eecs678-kvm:~/orig$ tar xvzf linux-184.108.40.206.tar.gz
- Next, you will need to clean out the custom kernel that you
implemented for this assignment. Note, this will remove many built files
and may cause a longer build time (10 to 15 minutes) the next time you
build your modified kernel:
mjantz@eecs678-kvm:~/orig$ cd /home/mjantz/kernel/linux-220.127.116.11/
mjantz@eecs678-kvm:~/kernel/linux-18.104.22.168$ make-kpkg clean
- Now, create the patch file using the diff command. Please name your
patch file: $(STUDENT_ID)_scheduling.patch:
mjantz@eecs678-kvm:~/kernel/linux-22.214.171.124$ cd /home/mjantz
mjantz@eecs678-kvm:~$ diff -Naur orig/linux-126.96.36.199 kernel/linux-188.8.131.52 > 1334070_scheduling.patch
Examine the generated patch file to make sure that it contains only the
differences that you have written into your modified kernel tree and that
it is not too large.
- Finally, copy your patch file to your EECS account so you can email
it to me:
mjantz@eecs678-kvm:~$ scp 1334070_scheduling.patch cycle2.eecs.ku.edu:~/Desktop/
- Where can I get more information on the design of the scheduler in
A. This book is a helpful guide for working in the
Linux kernel. The most relevant sections for this project are 2.5, 2.6,
- I do not understand how to use the kernel linked list. How does it
A. For the purposes of this project, you do not need to understand exactly
how the linked list API works -- just how to use it. This website gives
an overview of how to use the list and also explains how it works.