1.\" Copyright (c) 1999 Robert Nordier 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND 14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 17.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 18.\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 19.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 20.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 22.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 23.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24.\" 25.Dd October 1, 2013 26.Dt BOOT0CFG 8 27.Os 28.Sh NAME 29.Nm boot0cfg 30.Nd boot manager installation/configuration utility 31.Sh SYNOPSIS 32.Nm 33.Op Fl Bv 34.Op Fl b Ar boot0 35.Op Fl d Ar drive 36.Op Fl e Ar bell character 37.Op Fl f Ar file 38.Op Fl i Ar volume-id 39.Op Fl m Ar mask 40.Op Fl o Ar options 41.Op Fl s Ar slice 42.Op Fl t Ar ticks 43.Ar disk 44.Sh DESCRIPTION 45The 46.Fx 47.Sq boot0 48boot manager permits the operator to select from which disk and 49slice an i386 machine (PC) is booted. 50.Pp 51Note that what are referred to here as 52.Dq slices 53are typically called 54.Dq partitions 55in 56.No non- Ns Bx 57documentation relating to the PC. 58Typically, only non-removable disks are sliced. 59.Pp 60The 61.Nm 62utility optionally installs the 63.Sq boot0 64boot manager on the specified 65.Ar disk ; 66and allows various operational parameters to be configured. 67.Pp 68On PCs, a boot manager typically occupies sector 0 of a disk, which is 69known as the Master Boot Record (MBR). 70The MBR contains both code (to which control is passed by the PC BIOS) 71and data (an embedded table of defined slices). 72.Pp 73The options are: 74.Bl -tag -width indent 75.It Fl B 76Install the 77.Sq boot0 78boot manager. 79This option causes MBR code to be replaced, without 80affecting the embedded slice table. 81.It Fl b Ar boot0 82Specify which 83.Sq boot0 84image to use. 85The default is 86.Pa /boot/boot0 87which will use the video card as output, alternatively 88.Pa /boot/boot0sio 89can be used for output to the COM1 port. 90(Be aware that nothing will be output to the COM1 port unless the 91modem signals DSR and CTS are active.) 92.It Fl d Ar drive 93Specify the drive number used by the PC BIOS in referencing the drive 94which contains the specified 95.Ar disk . 96Typically this will be 0x80 for the first hard drive, 0x81 for the 97second hard drive, and so on; however any integer between 0 and 0xff 98is acceptable here. 99.It Fl e Ar bell character 100Set the character to be printed in case of input error. 101.It Fl f Ar file 102Specify that a backup copy of the preexisting MBR should be written to 103.Ar file . 104This file is created if it does not exist, and replaced if it does. 105.It Fl i Ar volume-id 106Specifies a volume-id (in the form XXXX-XXXX) to be saved at location 1070x1b8 in the MBR. This information is sometimes used by NT, XP and Vista 108to identify the disk drive. The option is only compatible with version 2.00 109of the 512-byte boot block. 110.It Fl m Ar mask 111Specify slices to be enabled/disabled, where 112.Ar mask 113is an integer between 0 (no slices enabled) and 0xf (all four slices 114enabled). 115Each mask bit enables corresponding slice if set to 1. 116The least significant bit of the mask corresponds to slice 1, 117the most significant bit of the mask corresponds to slice 4. 118.It Fl o Ar options 119A comma-separated string of any of the following options may be 120specified (with 121.Dq no 122prepended as necessary): 123.Bl -tag -width indent 124.It packet 125Use the disk packet (BIOS INT 0x13 extensions) interface, 126as opposed to the legacy (CHS) interface, when doing disk I/O. 127This allows booting above cylinder 1023, but requires specific 128BIOS support. 129The default is 130.Sq packet . 131.It setdrv 132Forces the drive containing the disk to be referenced using drive 133number definable by means of the -d option. 134The default is 135.Sq nosetdrv . 136.It update 137Allow the MBR to be updated by the boot manager. 138(The MBR may be updated to flag slices as 139.Sq active , 140and to save slice selection information.) 141This is the default; a 142.Sq noupdate 143option causes the MBR to be treated as read-only. 144.El 145.It Fl s Ar slice 146Set the default boot selection to 147.Ar slice . 148Values between 1 and 4 refer to slices; a value of 5 refers to the 149option of booting from a second disk. 150The special string 151.Dq PXE 152or a value of 6 can be used to boot via PXE. 153.It Fl t Ar ticks 154Set the timeout value to 155.Ar ticks . 156(There are approximately 18.2 ticks per second.) 157.It Fl v 158Verbose: display information about the slices defined, etc. 159.El 160.Sh FILES 161.Bl -tag -width /boot/boot0sio -compact 162.It Pa /boot/boot0 163The default 164.Sq boot0 165image 166.It Pa /boot/boot0sio 167Image for serial consoles (COM1,9600,8,N,1,MODEM) 168.El 169.Sh EXIT STATUS 170.Ex -std 171.Sh EXAMPLES 172To boot slice 2 on the next boot: 173.Pp 174.Dl "boot0cfg -s 2 ada0" 175.Pp 176To enable just slices 1 and 3 in the menu: 177.Pp 178.Dl "boot0cfg -m 0x5 ada0" 179.Pp 180To go back to non-interactive booting, use 181.Xr gpart 8 182to install the default MBR: 183.Pp 184.Dl "gpart bootcode -b /boot/mbr ada0" 185.Sh SEE ALSO 186.Xr geom 4 , 187.Xr boot 8 , 188.Xr gpart 8 189.Sh AUTHORS 190.An Robert Nordier Aq Mt rnordier@FreeBSD.org 191.Sh BUGS 192Use of the 193.Sq packet 194option may cause 195.Sq boot0 196to fail, depending on the nature of BIOS support. 197.Pp 198Use of the 199.Sq setdrv 200option with an incorrect -d operand may cause the boot0 code 201to write the MBR to the wrong disk, thus trashing its previous 202content. Be careful. 203