From owner-svn-doc-head@FreeBSD.ORG Mon Apr 21 22:51:02 2014 Return-Path: Delivered-To: svn-doc-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A1756AB; Mon, 21 Apr 2014 22:51:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 258C51239; Mon, 21 Apr 2014 22:51:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LMp2gb075011; Mon, 21 Apr 2014 22:51:02 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LMp2Te075010; Mon, 21 Apr 2014 22:51:02 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201404212251.s3LMp2Te075010@svn.freebsd.org> From: Dru Lavigne Date: Mon, 21 Apr 2014 22:51:02 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44623 - head/en_US.ISO8859-1/books/handbook/boot X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 22:51:02 -0000 Author: dru Date: Mon Apr 21 22:51:01 2014 New Revision: 44623 URL: http://svnweb.freebsd.org/changeset/doc/44623 Log: Editorial review of boot stages. Format loader built-in commands as a table. More commits to come. Sponsored by: iXsystems Modified: head/en_US.ISO8859-1/books/handbook/boot/chapter.xml Modified: head/en_US.ISO8859-1/books/handbook/boot/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/boot/chapter.xml Mon Apr 21 21:29:57 2014 (r44622) +++ head/en_US.ISO8859-1/books/handbook/boot/chapter.xml Mon Apr 21 22:51:01 2014 (r44623) @@ -173,18 +173,13 @@ Master Boot Record (MBR) - The code in the MBR or boot manager is + The boot manager code in the MBR is sometimes referred to as stage zero of the - boot process. This section discusses two boot managers: - boot0 and - LILO. - - - The <application>boot0</application> Boot - Manager: + boot process. By default, &os; uses the + boot0 boot manager. - The MBR installed by &os;'s installer - or &man.boot0cfg.8; is based on + The MBR installed by the &os; installer + is based on /boot/boot0. The size and capability of boot0 is restricted to 446 bytes due to the slice table and 0x55AA @@ -192,7 +187,6 @@ boot0 and multiple operating systems are installed, a message similar to this example will be displayed at boot time: - <filename>boot0</filename> Screenshot @@ -203,7 +197,7 @@ F2 FreeBSD Default: F2 - Other operating systems, in particular &windows;, will + Other operating systems will overwrite an existing MBR if they are installed after &os;. If this happens, or to replace the existing MBR with the &os; @@ -219,65 +213,37 @@ Default: F2 for the first SCSI disk. To create a custom configuration of the MBR, refer to &man.boot0cfg.8;. - - - The LILO Boot Manager: - - To install this boot manager so it will also boot &os;, - boot into Linux and add the following to the existing - /etc/lilo.conf configuration: - - - other=/dev/hdXY -table=/dev/hdX -loader=/boot/chain.b -label=FreeBSD - - Specify &os;'s primary partition and drive using Linux - specifiers, replacing X with the - Linux drive letter and Y with the - Linux primary partition number. For a SCSI - drive, change /dev/hd to - /dev/sd. The - line can be omitted if - both operating systems are installed on the same drive. Next, - run /sbin/lilo -v to commit the new - changes. Verify these are correct by checking the screen - messages. Stage One and Stage Two Conceptually, the first and second stages are part of the - same program, on the same area of the disk. Because of space + same program on the same area of the disk. Because of space constraints, they have been split into two, but are always installed together. They are copied from the combined - /boot/boot by the installer or - &man.bsdlabel.8;. + /boot/boot by the &os; installer or + bsdlabel. - They are located outside file systems, in the first track + These two stages 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 + 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. + continue the boot process. - boot1 is very simple, since it can - only be 512 bytes in size, and knows just enough about the + The first stage, boot1, is very simple, since it can + only be 512 bytes in size. It knows just enough about the &os; bsdlabel, which stores information about the slice, to find and execute boot2. - boot2 is slightly more sophisticated, - and understands the &os; file system enough to find files, and + Stage two, boot2, is slightly more sophisticated, + and understands the &os; file system enough to find files. It can provide a simple interface to choose the kernel or loader - to run. - - However, &man.loader.8; is much more sophisticated and - provides a boot configuration which is run by - boot2. + to run. It runs loader, which is much more sophisticated and + provides a boot configuration file. If the boot process is + interrupted at stage two, the following interactive screen is + displayed: <filename>boot2</filename> Screenshot @@ -287,26 +253,23 @@ Default: 0:ad(0,a)/boot/loader boot: - &man.bsdlabel.8; can be used to replace the installed + To replace the installed boot1 and - boot2: - - &prompt.root; bsdlabel -B diskslice - - where diskslice is the disk and + boot2, use bsdlabel, + where diskslice is the disk and slice to boot from, such as ad0s1 for the first slice on the first IDE - disk. + disk: - - Dangerously Dedicated Mode + &prompt.root; bsdlabel -B diskslice + If just the disk name is used, such as - ad0, &man.bsdlabel.8; will create a - dangerously dedicated disk, without slices. + ad0, bsdlabel will create the disk in + dangerously dedicated mode, without slices. This is probably not the desired action, so double check the - diskslice passed to - &man.bsdlabel.8; before pressing + diskslice + before pressing Return. @@ -316,16 +279,16 @@ boot: boot-loader - The loader is the final stage of the three-stage - bootstrap, and is located on the file system, usually as + The loader is the final stage of the three-stage + bootstrap process. It is located on the file system, usually as /boot/loader. - The loader is intended as an interactive method for + The loader is intended as an interactive method for configuration, using a built-in command set, backed up by a more powerful interpreter which has a more complex command set. - During initialization, the loader will probe for a + During initialization, loader will probe for a console and for disks, and figure out which disk it is booting from. It will set variables accordingly, and an interpreter is started where user commands can be passed from @@ -334,7 +297,7 @@ boot: loader loader configuration - The loader will then read + The loader will then read /boot/loader.rc, which by default reads in /boot/defaults/loader.conf which sets reasonable defaults for variables and reads @@ -343,166 +306,135 @@ boot: these variables, loading whichever modules and kernel are selected. - Finally, by default, the loader issues a 10 second wait + Finally, by default, loader issues a 10 second wait for key presses, and boots the kernel if it is not interrupted. If interrupted, the user is presented with a prompt which understands the command set, where the user may adjust variables, unload all modules, load modules, and then - finally boot or reboot. + finally boot or reboot. lists the most + commonly used loader commands. For + a complete discussion of all available commands, refer to + &man.loader.8;. - + Loader Built-In Commands - These are the most commonly used loader commands. For a - complete discussion of all available commands, refer to - &man.loader.8;. - - - - autoboot seconds - - - Proceeds to boot the kernel if not interrupted + + + + Variable + Description + + + + + + autoboot seconds + Proceeds to boot the kernel if not interrupted within the time span given, in seconds. It displays a countdown, and the default time span is 10 - seconds. - - + seconds. + - - boot + + boot -options - kernelname - - - Immediately proceeds to boot the kernel, with any + kernelname + Immediately proceeds to boot the kernel, with any specified options or kernel name. Providing a kernel name on the command-line is only applicable after an - unload command has been issued; - otherwise the previously-loaded kernel will be - used. - - - - - boot-conf - - - Goes through the same automatic configuration of + unload has been issued. + Otherwise the previously-loaded kernel will be + used. + + + + boot-conf + Goes through the same automatic configuration of modules based on specified variables, most commonly kernel. This only makes sense if unload is used first, before - changing some variables. - - - - - help - topic + changing some variables. + - - Shows help messages read from + + help + topic + Shows help messages read from /boot/loader.help. If the topic given is index, the list of - available topics is displayed. - - - - - include filename - … - - - Processes the file with the given filename. The - file is read in and interpreted line by line. An - error immediately stops the include command. - - + available topics is displayed. + - - load -t - type - filename + + include filename + … + Reads the specified file and interprets it line by line. An + error immediately stops the include. + - - Loads the kernel, kernel module, or file of the + + load -t + type + filename + Loads the kernel, kernel module, or file of the type given, with the specified filename. Any arguments after filename - are passed to the file. - - - - - ls -l - path + are passed to the file. + - - Displays a listing of files in the given path, or + + ls -l + path + Displays a listing of files in the given path, or the root directory, if the path is not specified. If is specified, file sizes will - also be shown. - - - - - lsdev - -v + also be shown. + - - Lists all of the devices from which it may be + + lsdev + -v + Lists all of the devices from which it may be possible to load modules. If is - specified, more details are printed. - - - - - lsmod - -v - - - Displays loaded modules. If - is specified, more details are shown. - - - - - more filename - - - Displays the files specified, with a pause at each - LINES displayed. - - - - - reboot - - - Immediately reboots the system. - - - - - set variable - set - variable=value - - - Sets the loader's environment variables. - - - - - unload - - - Removes all loaded modules. - - - - + specified, more details are printed. + + + + lsmod + -v + Displays loaded modules. If + is specified, more details are shown. + + + + more filename + Displays the files specified, with a pause at each + LINES displayed. + + + + reboot + Immediately reboots the system. + + + + set variable, set + variable=value + Sets the specified environment variables. + + + + unload + Removes all loaded modules. + + + +
+ - + Loader Examples Here are some practical examples of loader usage: @@ -547,7 +479,6 @@ boot: load -t userconfig_script /boot/kernel.conf -