Craig Van Degrift / firstname.lastname@example.org / content last revised September 9, 2000
This is the primary reference for making boot disks. It is difficult for beginners, but an essential document for anyone making their own boot disks.
A few notes on this HOWTO:
- The one-diskette version (boot/root) where one puts both the kernel and root filesystem on a single diskette is not worth the hassle. The two diskette (boot and root) arrangement is best.
- Use the loopback method. It seems strange and complicated at first reading, but with the help of a couple of scripts, it is really quite easy and flexible. losetup is not needed.
- I ignored the sections on PAM and NSS (at least for now).
- For most systems, the full compressed kernel with all drivers built in (no modules) as well as the lilo files and "kernel filesystem" can easily fit on a single diskette. This simplifies the creation and use of the diskette set.
- Don't worry about how the pros do it (section 9).
A guide to configuration and compilation of the Linux kernel
Useful examples of how to setup lilo.conf for 5 different situations.
A guide to the use of command-line Linux programs needed to write CD-ROMs.
The Technical Overview is quite confusing, but the best documentation we have (other than the linux source code) for the structure of the linux kernel image and how it is loaded by Lilo.
The User's Guide provides extensive documentation for the variety of command line and configuration options possible when using LILO.
The official layout of /dev, specifying names and major/minor node values.
This is packaged with the CD writing program cdrecord
During boot, the kernel can preload ramdisk device /dev/ram0 (a.k.a. /dev/ram or /dev/ramdisk) from a floppy drive (/dev/fd0 or /dev/fd1) as specified by the kernel boot parameter root=... and make it the root device. This is the method used for loading the root filesystem in the two-diskette boot set.
In newer kernels (2.2.12 or so and later) this feature is compatible with an initial ramdisk. Kernel boot parameter load_ramdisk=2 is then specified and the diskette filesystem is loaded into /dev/ram1 while the initial ramdisk is loaded into /dev/ram0. The initial ramdisk is initially mounted as root, and when it exits, the ramdisk loaded from the diskette(s) is mounted as root. Either can be compressed, but only an uncompressed, non-initial ramdisk can be can be loaded from multiple diskettes.
This document describes the creation and use of initial ramdisks. Additional clarifications may be obtained by examination of the source code in linux/init/main.c, linux/fs/super.c, linux/drivers/block/rd.c, and linux/drivers/block/genhd.c.
The "initial ramdisk" must be loaded by the Lilo boot loader into memory from the device and blocks specified in the Lilo map file as a result of an initrd=... specification in lilo.conf. The initial ramdisk is temporarily mounted as the root filesystem, and a special file (program or shell script) in it, /initrdrc, is then run. When /initrdrc exits, the device specified by root=... in lilo.conf is then mounted as the final root filesystem.
An "initial ramdisk" that remains as the permanent root filesystem is used for loading the root filesystem in the CD-ROM boot method.
- Running Linux by Matt Welsh, Matthias Kalle Dalheimer & Lar Kaufman (O'Reilly Press, $35)
This is an outstanding book to help beginners and intermediate users better understand the functioning and tuning of Linux. It has good under-the-hood type of information to help the user when simple user directions don't work. Most books simply give directions for how to use a system when it has already been properly configured.
- Linux Core Kernel Commentary by Scott Maxwell (CoriolisOpen Press, $40)
Source code listing for the core 40,000 lines of Linux kernel code plus well-worded commentary. An essential book for those who really want to understand Linux. It does not include many parts of Linux, but by studying this book, you will learn Linux coding styles and be better able to read the remaining source code.
Note: "man -t xxx | lpr -Pps" or something similar prints hardcopy.
- /sbin/lilo program and its command line options
- some of the specifications possible in the lilo.conf file
- the operation of the ramdisk initialized by the boot loader.
- ramdisk device description (mine is an old, inadequate man page)
- set kernel boot parameters - specifically the device with the root filesystem
- invocation of rdev -s that specifies the virtual memory swap device
- invocation of rdev -r that specifies if/how ramdisk is filled at boot (old man pages do not apply to newer kernels)
- invocation of rdev -v that sets the console video mode in kernel image
- invocation of rdev -R that sets rw/ro flag for root directory in kernel image
- description of kernel boot parameters
- /etc/inittab run level specification file used by /sbin/init
- /sbin/init program
- alternate invocation of init program for changing runlevels
- mount -o loop
- filesystem mounting, needed for use with
- filesystem dismounting
- /etc/fstab file specifying filesystem mount parameters
- dangerous, but crucial device-device copy program - use carefully
- cp -dpR
- recursively copy a directory and subdirectories preserving permissions and symbolic links (same as "cp -a")
- compression program
- decompression invocation for gzip
- mke2fs -m 0
- layout a new filesystem on a device with no special reserved space
- make device node for device
- change permissions file or device
- change owner of file or device
- remove symbol info from object files to minimize their size
- show library dependencies of an object file
- setup library links and cache
- determine amount of used disk space per file or directory
- determine usage of entire filesystems
- run a command or shell with an alternate root directory
- ln -s
- make a symbolic link to another file or directory
- set/show virtual terminal parameters
- coordinate login and start shell (used with respawn in /etc/inittab)
- login program
- single-user login
- kernel daemon that handles disk caching
- find files using database maintained by updatedb
- update database for locate
- carefully shutdown system
- halt, reboot, or power-off the computer
- handle control-alt-del key signal response
- examine system tasks activity
- bash shell
Notes concerning special RAM addresses and multi-byte storage
- 0x00007c00 Address where BIOS puts boot sector
- 0x00010000 Start of small Linux kernel (zImage)
- 0x000a0000 Start of memory-mapped I/O address space
- 0x000fffff End of memory-mapped I/O address space
- 0x000fffff Top of 1st MB of memory
- 0x00100000 Start of large Linux kernel (bzImage)
- 0xffff0000 Start of BIOS address space
- 0xfffffff0 Where processor looks for first instruction during boot
- 0xffffffff Top of processor address space
- Intel storage is little endian, e.g. the 16-bit word 0xaa55 when placed at RAM location 0x00fe has 0x55 at 0x00fe and 0xaa at 0x00ff.
- Internet protocols are big endian, the most significant byte is at the specified RAM address, followed by the next most significant byte, etc..
Last updated: April 8, 2006
Contact Craig Van Degrift if you have problems or questions with this web site.