CS380L: Advanced Operating Systems

Emmett Witchel

Assignment #0

Booting, kernel modules, and discovering devices

The goal of this assignment is to be able to compile and boot the kernel of User-Mode Linux.  If you have never built or installed a kernel before THEN START THIS ASSIGNMENT EARLY.  It can take a long time.

Download the latest Linux kernel release from kernel.org. Configure and build the kernel with no modules. Boot the kernel in User-Mode Linux.  Create the root disk however you want, but make sure you can mount a disk-resident file system, and get the network to initialize properly.

Boot the Kernel, and run dmesg to capture the kernel output from the boot. In your writeup, for each device, quote the parts of the dmesg output that show the kernel discovering that device, and then report what kind of device it is, and how you made your determination.

Figure out some way to time the boot.

Now, reconfigure your kernel to use as many modules as you can. Try to support each device by a module. You get a bit of extra credit if you can make the driver for your boot disk a module. Run dmesg and report if the discovery of any devices have changed. Describe which modules you used in your report. 

Finally, report the performance of the module-heavy boot versus the original boot. Report any other metric you think indicates how much more "complicated" was the module-heavy boot.  /proc/meminfo might be useful.

Please report how much time you spent on the lab.

Here are some resources you may or may not find useful.

A tutorial on how to do this on the department machines can be found here.

Resources for creating a file system without root privilege.
http://user-mode-linux.sourceforge.net/old/fs_making.html

The slirp program can provide networking without root permission.  If you have networking, you can copy modules files into your simulated disk.
http://user-mode-linux.sourceforge.net/old/networking.html

Here is a technique to add files into your file system after your kernel has booted without using loopback mounts.
http://user-mode-linux.sourceforge.net/old/config.html

You can create a blank disk, mount it from your UML and configure it as a boot disk.
http://user-mode-linux.sourceforge.net/old/fs.html

Copy files into your simulated machine using hostfs.
http://user-mode-linux.sourceforge.net/old/hostfs.html

Download genext2fs and build it.  Build your own disk image, including device files, without root permission.
http://genext2fs.sourceforge.net/ 

Put your modules on an initial RAM disk that you create with mkcramfs.  I think mkinitrd requires root privilege to do the right thing.