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