Project 1: Warm-up with Linux
Due: Monday, 2/17, whenever.
The project is just a light warm-up to Linux kernel development. You will build a kernel, get it to run in some kind of virtualized environment, and change it a little to prove that you can indeed do so. Specifically, you'll add some counters into the Linux ext2 file system code, and add a system call to get the value of that counter.
Part 1: Kernel Building and Running
For this project, you can build and run Linux in any number of ways. One easy way to run Linux without a lot of virtual machine setup and pain is to use User-Mode Linux (UML), which basically allows you to run Linux as a user process on a Linux machine. Read more about it here online -- though be warned, some of that stuff is out of date.
To build Linux for use in UML mode, you should follow instructions
here. The steps
are pretty simple; the only tricky thing is configuration, which is probably
Once built, you'll have to find a disk image to boot the kernel from. This page lists a bunch; make sure to pick a 32-bit image (if you followed instructions and built a 32-bit kernel!); the more fully loaded images have lots of useful binaries in them, such as gcc, so please use one of those (e.g., Gentoo 32-bit).
Now you are ready to boot the kernel. Again you can follow instructions
from the UML website but they are simple:
If you've done all of this correctly, Linux will boot, and you will be able to log in as root with no password. Now onto the harder part: actually doing something in the kernel!
Part 2: Kernel Hacking
In this part of the project, you'll actually modify the kernel to show that you can indeed do so. What you'll do is simple: add a counter to the ext2 file system, and then show that you can query that counter.
The ext2 counter you should add will count how many times
As a debugging step, you should add a
To test this out, you might also want to make a separate partition for
ext2. To do this, you can run Linux UML with
Finally, you need to add a new system call to your kernel, to get the value
of the counter. Read online to find out how to do this. When done, you should
create a program within UML that calls your system call and gets the value of
the counter both before and after calling
Handing It In
To turn this in, you will create a screencast demo of what you have done. Show the entire process: how you built the kernel, how you run it, what you changed in it, and a demo of how that all works. The screencast should be something I can view easily on a Mac, i.e., Quicktime. The screencast should also be quick: less than 5 minutes.
Copy the screencast into your handin directory:
You should also copy relevant files that you have changed into the handin
Please also include a README file. In there, describe what you did a little bit. The most important bit, at the top, however, should be the authorship of the project.