Principles of Operating Systems

(CMSC 421)

Installing Ubuntu 11.10 and Virtual Box

We would be writing both userland and kernel code on linux. So, irrepective of the Operating System that you have on your machines (laptops, desktops), you should install a virtual machine with Ubuntu 11 (could be 11.10, 11.04) on it. I would not recommend the Ubuntu 12.04 because of the PAE issue (see here ). There are hacks around it, but for a default installation, I would recommend Ubuntu 11.

Instructions for installing VirtualBox can be found here

Instructions for installing Ubuntu 11.10 in VirtualBox can be found here

The tutorial points to the default Ubuntu install page (which has Ubuntu 12.04). However, use the following link instead to download Ubuntu 11

Linux kernel (Download and compiling)

The first step towards downloading the linux kernel source is to download a utility called curl . Curl is used to download files from a specific URL. Type curl and see if it is installed. If not install curl sudo apt-get install curl We will download linux kernel 2.6.39 from kernel.org. Type in the command curl -O http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.1.tar.bz2 . This should download the linux kernel source in the directory that you typed in the command. Unzip and untar the linux kernel source. tar jxf linux-2.6.39.1.tar.bz2 .

To Build the kernel, you need some other tools. Download these tools using the command: sudo apt-get install build-essential qt-sdk patch diffutils fakeroot kernel-package. change to the directory and follow the following steps:

make mrproper (This cleans up the source tree and removes the configuration files, it is like make clean, but does some more extra stuff of cleaning)

make xconfig (This command opens up a nice user interface where you can select the options that you want to build into the kernel)

make -j4 bzImage (This will compile the kernel source)

make modules (This will compile the kernel modules)

make modules_install (This will install the modules /lib/modules/linux-versionnumber/)

make install (This will create initial ramdisk and install stuff in the /boot directory)

A great guide to installing the linux kernel can be found here