CSE 451 - Recitation 2: VMWare, Linux, Project 1


Project 1 has been released -- it's due a week from Friday.
This project has three components:

Goals of today's section:

Downloading and Compiling Linux:

You'll want to be compiling Linux, on Linux. Since we're going to be running it inside an x86 emulator, you also want to be compiling from an x86 host. (You can "cross-compile" Linux if you want, but it's considerably more tricky.) You can do it under Cygwin, too, but the same rule applies.

We've provided a machine named forkbomb which can do your compiling for you. You can either ssh in to this machine, do your editing on your files there, and then compile, or you can edit local copies of your files, scp them up, and then compile. The choice is yours; either works equally well. Alternatively, if you have your own x86 Linux machine, you can do your editing & compiling there, too.

(Explain /homes/iws/username vs. /cse451/username)

A copy of the Linux kernel is stored in /cse451/projects/linux-2.6.13.2.tar.bz2. This is not necessarily the most recent version of Linux, but that's OK. This is the official version for the course -- it's what we're going to use. You should make a copy of this file into your compile directory, and unzip it:

cd /cse451/your_username
cp /cse451/projects/linux-2.6.13.2.tar.bz2 .
tar vjxf linux-2.6.13.2.tar.bz2
Feel free to explore the subdirectories that came out of this.
To compile:
cd linux-2.6.13.2/
make bzImage

Usually when compiling Linux, there are several more steps, like ``make menuconfig'', if you've done this before. Don't worry about this -- the tarball that we provided is pre-configured to run just fine in the VMWare environment. We've turned on/off everything how it should be. (Change these settings at your own risk.) You may also be used to modules. Don't worry about these, we're not building any modules.

The ``make'' process will take several minutes (maybe 5-10, depends on how many of you are doing this at once). The result will be a file ./arch/i386/boot/bzImage.

Subsequent compilation of the kernel will run much faster, unless you modify a .h file, in which case it'll need to do the full rebuild. But for a single-file modification, it'll compile in less than a minute.

Running VMWare

VMWare, unfortunately, does not run on the Linux machines in the school. (This is because VMWare needs to install its own kernel-modules to natively support some interaction between VM images and USB devices, and UWCSE support isn't willing to run crazy tricked-out kernels natively.)

Terminology:

For you to run the Linux kernel image that you just compiled, you're going to have to do it within VMWare. This is actually advantageous for several reasons:

Computers in the computer lab with Windows XP are set up with VMWare already. These computers also contain a VMWare image that will boot a copy of Linux. Only students in CSE 451 can access this. Important: Do not mess with the VMWare settings on these machines. They're set up precisely.

You can download VMWare and install it on your computer at home too. You'll also need to download the VMware Linux image from forkbomb. Instructions are online.

An important note about VMWare: It's a non-persistent image. That means that any changes you make are lost when you close VMWare. (This is actually good, regarding the "you can hose the machine" point above)

To run your own kernel:

Advice for the project:

More topics: