3.3. Booting from floppy disk[7]

At first it might look like extra work to develop a bootdisk if you want a bootable CD-ROM. But the first thing you should know about bootable CD-ROMs is that they in fact contain the image of a bootdisk. So a bootable CD-ROM is, from the developer's point of view, very similar to a bootable floppy disk with some additions. Furthermore, we can develop faster when using bootdisks (especially in combination with the Bochs emulator). TODO: add notes about Bochs below.

3.3.1. The components of a bootdisk

To create a Linux bootdisk, we have to consider the following factors:

  • We need to compile a custom Linux kernel for the disk. We should make it as small as possible (thus kicking out all the fancy stuff), while keeping the necessary functionality.

  • To make the disk bootable, the first sector has to be a boot sector from either a boot loader or the beginning of the Linux kernel. We'll use the increasingly popular GNU GRUB bootloader for this purpose.

  • We need a root filesystem that contains everything to support a full Linux-based system. To save space, we will rely on the BusyBox and uClibc packages, and we will examine some of the methods the Linux kernel provides to compress the contents of the root filesystem.

3.3.2. uClibc: some thoughts

You may not necessarily see the reason why we need a C library other than the GNU libc. Just look at your /lib/libc-*.so (or do strip --strip-debug -o ./libc-stripped.so /lib/libc-*.so and look at libc-stripped.so) and you will recognize that this baby won't leave much space (if at all) on the bootdisk for any useful programs. So obviously we need a smaller alternative. I chose uClibc for this.

3.3.3. uClibc: where to start

Download: http://www.uclibc.org/downloads/ (also included in alindis-0.1.0.tar.gz)

License: GNU General Public License (GNU GPL), version 2.

http://www.uclibc.org/ says: “[uClibc] is much smaller than the GNU C Library, but nearly all applications supported by glibc also work perfectly with uClibc. Porting applications from glibc to uClibc typically involves just recompiling the source code. uClibc even supports shared libraries and threading. It currently runs on standard Linux and MMU-less (also known as μClinux) systems with support for alpha, ARM, i386, i960, h8300, m68k, mips/mipsel, PowerPC, SH, SPARC, and v850 processors.”

We'll be using uClibc 0.9.12 for the following experiments.

If you're working with the alindis-0.1.0.tar.gz tarball, go to the directory sandbox/uClibc/. There you'll find uClibc-0.9.12.tar.bz2. Alternatively, you can download the uClibc tarball from the location mentioned above and store it wherever you want.

Now expand uClibc-0.9.12.tar.bz2 and cd into the newly created directory uClibc-0.9.12.

3.3.4. uClibc: installation

TODO: write more text.

3.3.5. BusyBox: where to start

Download: http://www.busybox.net/downloads/ (also included in alindis-0.1.0.tar.gz)

License: GNU Library General Public License (GNU LGPL), version 2. This license is compatible with the GNU GPL used by the Alindis project.

The BusyBox website at http://www.busybox.net/ provides this description: “BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete POSIX environment for any small or embedded system.”

We'll be using BusyBox 0.60.3 for the following experiments.

If you're working with the alindis-0.1.0.tar.gz tarball, go to the directory sandbox/busybox/. There you'll find busybox-0.60.3.tar.bz2. Alternatively, you can download the BusyBox tarball from the location mentioned above and store it wherever you want.

Now expand busybox-0.60.3.tar.bz2 and cd into the newly created directory busybox-0.60.3.

3.3.6. BusyBox: configuration

Read README.

TODO: write (much) more text.



[7] Some of this information originates from [Faw02]. The legal exception concerning derived portions applies to this section.