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.

The Project Labs

There are two dedicated Linux workstations for this course: spinlock.cs.washington.edu and coredump.cs.washington.edu. Most of your work will be done on these machines: you edit the source on them, and compile the kernel there as well.  The machines are accessible from anywhere in the world: it's just normal, remote login (which in this department means using a secure client, like ssh).   Each of you should already have an account created on the two machines. 

You'll also be working on your projects in the two general purpose instructional labs, Sieg 232 and 329. You will be using an application called VMware which is available on only the newer Dell Optiplex GX260 machines with the Pentium 4 processors and the low profile black cases.

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 to 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. You do this by using VMware to create a virtual PC, on which you boot your kernel. 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 Windows XP 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 Windows XP machines, and from there, using a process we describe below, you'll copy the image into VMware and boot into your new kernel. Please note that this is a new (as of October 2002) version of VMware and a new setup, so there may be some initial problems. Please let the TAs know if something is not working according to the instructions.

spinlock and coredump

To remotely log into spinlock or coredump, you need to use an SSH client. On the lab Windows XP machines, you can find an SSH client as:
Start->All Programs->Internet and Remote Connections->SSH->Secure Shell Client
Another popular SSH client is PuTTY, which is available here and here (You want the "latest development snapshot".). PuTTY allows you to work in full-screen mode with color.

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. Your local disk space is in /cse451/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.)

You will use a secure FTP client to copy your kernel image from your directory on the Linux servers (coredump or spinlock) to the particular Windows XP machine that you're using, when you're ready to install the kernel image in VMware/linux. To start a secure FTP client, do...

Start->All Programs->Internet and Remote Connections->SSH->Secure File Transfer Client
Note that your files are located at "/cse451/username/" on coredump and/or spinlock.

VMware

To launch VMware, simply click the VMware icon on the desktop or do...
Start->All Programs->VMware->VMware Workstation
When the VMware window pops up, click "Open an existing configuration". If Linux (or Linux.vmx) is on the list, double click it, otherwise browse to and select c:\Program Files\VMware\vms\linux\Linux\Linux.vmx. 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 Windows XP 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 Windows XP 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 Windows XP 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 in the initial dialog box, then press the Power On button to boot Linux inside VMware. You may see a message saying, "The keyboard hook timeout value is not set to the value recommended by VMware Workstation." —Just click OK.

VMWare may possibly prompt you with an error message regarding a CPUID bit. This message can be safely ignored. You will then 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.

VMware will take over your keyboard and mouse so that you won't be able to readily switch to other applications or even close VMware. To get out of this, just press Ctrl-Alt.

To get files from the outside world (e.g. the Windows machine you are working on) you use a special mount point that has been set up with VMware. All of the Windows XP machines that have VMware also have a D drive. Whatever files are in the D drive when you start up your virtual Linux machine will be available in the /mnt/dos directory in the virtual Linux machine. Thus, to get your new kernel into the virtual Linux machine, you will copy it to the D drive on the Windows machine you are using. Then, when you start up your virtual Linux machine, you can find that kernel file by typing "cd /mnt/dos".