Getting comfortable with the projects

The projects for this course will, for the most part, involve diving into the Linux OS kernel source code, and making some small modifications. There are two things that you need to be familiar with before you can effectively do these projects: the configuration of the lab machines that we have set up for you, and the process by which you compile, install, and test a new kernel that contains your modifications. This page describes these two things in detail. All questions should go to the course TA's, or if they are generally applicable to the class, to the course mailing list.

[ Project lab setup | Compiling your first kernel ]

The Project Labs

For this quarter, you'll be working on your projects in the two software labs, Sieg 232 and Sieg 329. In these labs, there are a total of 28 Win2K machines that have been configured with the software necessary for this course (VMware). There are also two dedicated linux workstations for this course: and

Each of you should already have an account created on one of the two machines. Everybody that is registered in section AA of the course has an account on spinlock; those of you registered for section AB are on coredump.

Roughly speaking, each project will involve the following phases:

  1. Read through the Linux source code: before you can modify the code to satisfy the project, you need to understand the code that you will modify. You will use your account on spinlock or coredump for this purpose: each of you will make a private copy of the kernel source tree in specially created directories on these machines (described below); you can then safely navigate through the source tree without fear that somebody else has changed it.

  2. Edit the Linux source code, and compile a new kernel: once you think you know what to do in order to do a project assignment, you need make your changes to the Linux source code (either by editing existing files, or by creating new files, or both). You will then compile a new kernel. Again, you will use spinlock or coredump for this; each of you will edit your private copy of the kernel source tree, and then compile the new kernel (using spinlock or coredump) from your modified private source tree.

  3. Test/benchmark your new kernel: once you've successfully compiled a new kernel image, you will then need to try it out. This quarter, instead of having dedicated physical machines for experimental kernels, we've installed VMware on 28 Win2K machines in Sieg 232 and Sieg 329. VMware is a virtual machine monitor: it is a software layer that perfectly emulates the x86 architecture, thereby allowing you to install and use any x86-based operating system on top of it. In other words, you can launch the VMware program on these Win2K machines, and then boot into Linux from inside VMware. So, once you've compiled a kernel image (which is simply an executable file), you will transfer the kernel image to one of these Win2K machines, and from there, using a process we describe below, you'll copy the image into VMware and boot into your new kernel.
As 451 students, you have priority access to the lab machines with VMware installed; all of these machines have signs on them attesting to this. However, if you look at the three phases above, you'll realize that you only need to use these machines during the third phase. I expect that you'll spend most of your time on phase 1 and phase 2. Please do not exercise your priority to get onto these machines if you're just working on phase 1 or 2; save that power for phase 3, otherwise you'll needlessly cause friction with other classes' students in these labs.

spinlock and coredump

To remotely log into spinlock or coredump, you need to use ssh. On the lab Win2K machines, you can find ssh as:
Start->Programs->Desktop->Tools->Tera Term->SSH Telnet
If you start an Xwindows server before you run ssh, then you'll be able to run Xwindows clients on spinlock or coredump. (For example, you'll be able to launch the X emacs client, or netscape.) To start an Xwindows server, run:
Start->Programs->Reflection->Reflection X
Your home directory on these machines is your usual /homes/iws/ directory, and it is backed up. However, due to the usual disk space quotas, you will not have enough quota in your home directory to copy or compile a kernel. Instead, we have provided each of you with local disk space on coredump or spinlock (on whichever machine your account is on). Your local disk space is in /cse451kernels/username, where username is your unix account name. So, when you make your copy of the linux kernel, and when you edit or compile it, you should do so in this local directory, not your home account.

However, these local directories are not backed up. This means that if the disk crashes on either of these machines, all of the files in your local directory will be blown away. Thus, I strongly recommend that you keep copies of critical files in your home account; in particular, I'd keep a copy of every file that you've edited or created, and copies of the kernel images that you create. (Don't copy the entire kernel source tree, though: only copy changed files.)

One more detail: your local directory on spinlock or coredump can be accessed from the Win2K machines using Samba. To do this, you need to know which machine your directory is on (either spinlock or coredump; for me, my account is on spinlock), and the name of your user account (for example, johnny). Then, simply bring up an IE window, and type an URL like:

As another example, if your account name was homer, and your account was on coredump, you'd visit the URL:
This is how you will copy a kernel image from your local directory on the Linux servers to the particular Win2K machine that you're using, when you're ready to install the kernel image in VMware/linux.


To launch VMware, simply run:
When the dialog box pops up, select "Open an existing configuration". If Linux_2 is on the list, double click it, otherwise hit OK to browse, and then select D:\apps\VMware\VMs\Linux_2\Linux_2. By selecting this, VMware will boot into a version of Linux that has been carefully prepared for use with the 451 course. In particular, this configuration has the following properties:
  1. The hard drive has been set to be non-persistent; if you power down the virtual machine, and power it back on (or if you quit and restart VMware), then any changes you made to the file system inside VMware/linux will be lost. This is a good thing: it means every time you boot VMware/linux, it will boot into a well-known, sane configuration, with a working kernel. However, this means that when you install your new kernel, you can't power down the virtual machine; instead, you'll software reboot it from inside linux (as described below).

  2. VMware/linux has been configured for host-only networking; this means that VMware/linux can only communicate with the Win2K host that is running it, rather than the Internet at large. Similarly, the only way to get files into VMware/linux is to ftp them from the Win2K host on which you're running VMware/linux. This was done for security reasons.

  3. There is only one user account: user name root, and password rootpassword. Note that I am fearlessly advertising this account name and password on a world readable web site. The reason I'm not afraid to do this is because of properties 1 and 2 above. Because of 2, only people actually sitting at the Win2K machine can log into VMware/linux (and, in fact, only people enrolled in this course can run VMware), and because of 1, nothing you do can mess it up for other people.
We have one very strictly enforced rule for VMware usage: don't mess with the VMware configuration itself. If you do, we'll be extremely upset with you, since you might inadvertantly cause trouble for other people.

Once VMware starts up, and after you've selected Linux_2 in the initial dialog box, then press the Power On button to boot Linux inside VMware. You will see the boot sequence as Linux loads itself, initializes devices, etc., and once this has finished, you'll be asked to log in. Do so as username root, and password rootpassword.

To copy files into VMware/linux, you need to use ftp from the Win2K host running VMware. So, bring up an IE window, and visit the following URL: is the IP address of the Linux system running inside VMware (this IP address is the same irrespective of which Win2K machine you're using, thanks to the magic of host-only networking).

Compiling and running your first kernel



This document provides you with step-by-step instructions for building and testing a kernel. For further information on building kernels, refer to the Linux Kernel HOWTO (find it at The VMware web site ( has further information on VMware.

The Process

Part 1: Build a kernel image

Log onto spinlock or coredump. You should all have accounts on the machines now. SSH is available as

Start->Programs->Desktop Tools->Tera Term->SSH Telnet
on the Windows machines.

Change directory to /cse451kernels/username. You will be using this directory for your kernel development. Copy /cse451kernels/linux-2.4.0-text6IKD.tgz into this directory. This archive contains the kernel source code. Open it with the command tar zxvf.

Compile a kernel: make dep, then make bzImage. (Don't forget to read the Kernel HOWTO, available online at This will take a long time (i.e. 10 minutes or so) the first time you do it, but you won't be recompiling every file all the time, so it will go much faster later on.

Assuming compilation is successful, your new kernel image will created, and named ./arch/i386/boot/bzImage.

Part 2: Transfer image to VMware

Copy the new kernel image from arch/i386/boot/bzImage to the Win2K machine you will be using for testing. Make sure it is one of the machines that has VMware installed.

To do this, mount your work directory on spinlock or coredump as a remote drive under Windows. Open a Windows Explorer and select Tools->Map Network Drive..., then choose a drive letter and use \\spinlock\cse451kernels\username for the folder name (changing spinlock to coredump if necessary, and changing username to your unix account name).

Launch VMware with Start->Programs->VMware->VMware.

Select "Open an existing configuration". If Linux_2 is on the list, double click it, otherwise hit OK to browse. Select D:\apps\VMware\VMs\Linux_2\Linux_2.

Power on the virtual machine.

Login as "root", password "rootpassword". (To get the mouse back out of VMware, you need to hit Ctrl-Alt-Escape.)

From Windows, ftp the kernel image to This is the IP address of the Linux system running on the virtual machine, irrespective of which Win2K machine you are using. Again, use root/rootpassword.

You could also start the ftp transfer under Linux on VMware, but then you'd have to figure out the IP address of the Win2K box. For security reasons, networking under VMware is limited to the host (Win2K) machine.

Part 3: Test the kernel

The kernel image you just ftp'd should be under /root/ on VMware/Linux. Copy it to /boot/bzImage-2.4.0-test6.

The Linux boot loader is called lilo. At boot time, lilo selects an operating system image to run. You need to instruct lilo to select your image in order to test it.

Edit /etc/lilo.conf so that it looks like this. You might want to type this up in vi or emacs rather than copying, because of newline/linefeed problems.

Next, from Linux, run /sbin/lilo; this will install your new kernel, and tweak the boot sector of the disk to load into it.

Finally, reboot the virtual machine by issuing the command shutdown -r now (from the shell). When the machine reboots, you will see a lilo prompt; once you see this, type test in order to boot into your new kernel image. (Note that you need to click on contents of the vmware window with the mouse in order to have keyboard input fed to vmware/linux.)

Part 4: Some helpful hints