From ae4003ac85861403198d532983da6ac3c078b299 Mon Sep 17 00:00:00 2001 From: "Gary W. Swearingen" Date: Sat, 1 Oct 2005 21:54:12 +0000 Subject: [PATCH] Overhauled discussions of boot managers, adding some details. Approved by: keramida (mentor) --- .../books/handbook/boot/chapter.sgml | 140 ++++++++++-------- 1 file changed, 76 insertions(+), 64 deletions(-) diff --git a/en_US.ISO8859-1/books/handbook/boot/chapter.sgml b/en_US.ISO8859-1/books/handbook/boot/chapter.sgml index 2374ce6f33..02ef165e2c 100644 --- a/en_US.ISO8859-1/books/handbook/boot/chapter.sgml +++ b/en_US.ISO8859-1/books/handbook/boot/chapter.sgml @@ -71,32 +71,47 @@ load the operating system, which has become shortened to booting. + BIOS + + Basic Input/Output SystemBIOS + On x86 hardware the Basic Input/Output System (BIOS) is responsible for loading the operating system. To do this, the BIOS looks on the hard disk for the Master Boot Record (MBR), which must be located on a specific place on the disk. The BIOS has enough knowledge to load and run the MBR, and assumes that the MBR can then carry out the rest of the - tasks involved in loading the operating system. + tasks involved in loading the operating system, + possibly with the help of the BIOS. - - BIOS - + Master Boot Record (MBR) - - Basic Input/Output System - BIOS - + Boot Manager - If you only have one operating system installed on your disks then - the standard MBR will suffice. This MBR searches for the first bootable - slice on the disk, and then runs the code on that slice to load the - remainder of the operating system. + Boot Loader + + The code within the MBR is usually referred to as a boot + manager, especially when it interacts with the user. In this case + the boot manager usually has more code in the first + track of the disk or within some OS's file system. (A + boot manager is sometimes also called a boot loader, + but FreeBSD uses that term for a later stage of booting.) Popular boot + managers include boot0 (a.k.a. Boot + Easy, the standard &os; boot manager), + Grub, GAG, and + LILO. + (Only boot0 fits within the MBR.) + + If you have only one operating system installed on your disks then + a standard PC MBR will suffice. This MBR searches for the first bootable + (a.k.a. active) slice on the disk, and then runs the code on that slice to + load the remainder of the operating system. The MBR installed by + &man.fdisk.8;, by default, is such an MBR. It is based on + /boot/mbr. If you have installed multiple operating systems on your disks then - you can install a different MBR, one that can display a list of + you can install a different boot manager, one that can display a list of different operating systems, and allows you to choose the one to boot - from. FreeBSD comes with one such MBR which can be installed, and other - operating system vendors also provide alternative MBRs. + from. Two of these are discussed in the next subsection. The remainder of the FreeBSD bootstrap system is divided into three stages. The first stage is run by the MBR, which knows just enough to @@ -122,28 +137,28 @@ - The MBR, and Boot Stages One, Two, and Three + The Boot Manager and Boot Stages + + Boot Manager - MBR, <filename>/boot/boot0</filename> + The Boot Manager Master Boot Record (MBR) - The MBR installed by FreeBSD's installer and by boot0cfg(8) - are based on /boot/boot0. The MBR is the first - sector of a disk, outside slices. (The MBR installed by fdisk(8), - by default, is based on /boot/mbr; it is - similar to the PC-DOS MBR and it boots the slice marked - active without prompting the user as the - FreeBSD MBR does.) + The code in the MBR or boot manager is sometimes referred to as + stage zero of the boot process. This subsection + discusses two of the boot managers previously mentioned: + boot0 and LILO. - boot0 is very simple, since the - program in the MBR can only be 512 bytes in - size. - (Actually, it can only be 446 bytes because of the slice - table and the 0x55AA identifier at the end of the MBR). - If you have installed the FreeBSD MBR and have installed - multiple operating systems on your hard disks then you will see a - display similar to this one at boot time: + The <application>boot0</application> Boot Manager: + The MBR installed by FreeBSD's installer or &man.boot0cfg.8;, by + default, is based on /boot/boot0. + (The boot0 program is very simple, since the + program in the MBR can only be 446 bytes long because of the slice + table and 0x55AA identifier at the end of the MBR.) + If you have installed boot0 and + multiple operating systems on your hard disks, then you will see a + display similar to this one at boot time: <filename>boot0</filename> Screenshot @@ -164,38 +179,34 @@ Default: F2 &prompt.root; fdisk -B -b /boot/boot0 device - Where device is the device that you + where device is the device that you boot from, such as ad0 for the first IDE disk, ad2 for the first IDE disk on a second IDE controller, da0 for the first SCSI disk, - and so on. + and so on. Or, if you want a custom configuration of the MBR, + use &man.boot0cfg.8;. - If you are a Linux user, however, and prefer that - LILO control the boot process, you can - edit the /etc/lilo.conf file for FreeBSD, or - select - during the FreeBSD installation process. If you have installed the - FreeBSD boot manager, you can boot back into Linux and modify the - LILO configuration file - /etc/lilo.conf and add the following - option: + The LILO Boot Manager: + + To install this boot manager so it will also boot FreeBSD, first + start Linux and add the following to your existing + /etc/lilo.conf configuration file: other=/dev/hdXY -table=/dev/hdb +table=/dev/hdX loader=/boot/chain.b label=FreeBSD - which will permit the booting of FreeBSD and Linux via - LILO. In our example, we use - XY to determine drive number and - partition. If you are using a SCSI drive, you - will want to change /dev/hdXY to read - something similar to /dev/sdXY, which - again uses the XY syntax. The - can be omitted if you have - both operating systems on the same drive. You can now run - /sbin/lilo -v to commit your new changes to the - system, this should be verified with screen messages. + In the above, specify FreeBSD's primary partition and drive using + Linux specifiers, replacing X with the Linux + drive letter and Y with the Linux primary + partition number. If you are using a SCSI drive, you + will need to change /dev/hd to read something + similar to /dev/sd. The + line can be omitted if you have + both operating systems on the same drive. Now run + /sbin/lilo -v to commit your new changes to the + system; this should be verified by checking its screen messages. @@ -205,17 +216,18 @@ label=FreeBSD Conceptually the first and second stages are part of the same program, on the same area of the disk. Because of space constraints they have been split into two, but you would always install them - together. + together. They are copied from the combined file + /boot/boot by the installer or + disklabel (see below). - They are found on the boot sector of - the boot slice, which is where boot0, or any other program on the - MBR expects to find the program to run to - continue the boot process. The files in the - /boot directory are copies of the real files, - which are stored outside of the FreeBSD file system. + They are located outside file systems, in the first track of + the boot slice, starting with the first sector. This is where boot0, or any other boot manager, + expects to find a program to run which will + continue the boot process. The number of sectors used is easily + determined from the size of /boot/boot. - boot1 is very simple, since it too + boot1 is very simple, since it can only be 512 bytes in size, and knows just enough about the FreeBSD disklabel, which stores information