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 June 7, 2007 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 f Ar file 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 f Ar file 100Specify that a backup copy of the preexisting MBR should be written to 101.Ar file . 102This file is created if it does not exist, and replaced if it does. 103.It Fl m Ar mask 104Specify slices to be enabled/disabled, where 105.Ar mask 106is an integer between 0 (no slices enabled) and 0xf (all four slices 107enabled). 108.It Fl o Ar options 109A comma-separated string of any of the following options may be 110specified (with 111.Dq no 112prepended as necessary): 113.Bl -tag -width indent 114.It packet 115Use the disk packet (BIOS INT 0x13 extensions) interface, 116as opposed to the legacy (CHS) interface, when doing disk I/O. 117This allows booting above cylinder 1023, but requires specific 118BIOS support. 119The default is 120.Sq packet . 121.It setdrv 122Forces the drive containing the disk to be referenced using drive 123number definable by means of the -d option. 124The default is 125.Sq nosetdrv . 126.It update 127Allow the MBR to be updated by the boot manager. 128(The MBR may be updated to flag slices as 129.Sq active , 130and to save slice selection information.) 131This is the default; a 132.Sq noupdate 133option causes the MBR to be treated as read-only. 134.El 135.It Fl s Ar slice 136Set the default boot selection to 137.Ar slice . 138Values between 1 and 4 refer to slices; a value of 5 refers to the 139option of booting from a second disk. 140.It Fl t Ar ticks 141Set the timeout value to 142.Ar ticks . 143(There are approximately 18.2 ticks per second.) 144.It Fl v 145Verbose: display information about the slices defined, etc. 146.El 147.Sh FILES 148.Bl -tag -width /boot/boot0sio -compact 149.It Pa /boot/boot0 150The default 151.Sq boot0 152image 153.It Pa /boot/boot0sio 154Image for serial consoles (COM1,9600,8,N,1,MODEM) 155.El 156.Sh EXIT STATUS 157.Ex -std 158.Sh EXAMPLES 159To boot slice 2 on the next boot: 160.Pp 161.Dl "boot0cfg -s 2 ad0" 162.Pp 163To enable just slices 1 and 2 in the menu: 164.Pp 165.Dl "boot0cfg -m 0x3 ad0" 166.Pp 167To go back to non-interactive booting, use 168.Xr fdisk 8 169to install the default MBR: 170.Pp 171.Dl "fdisk -B ad0" 172.Pp 173.Sh SEE ALSO 174.Xr geom 4 , 175.Xr boot 8 , 176.Xr fdisk 8 177.Sh AUTHORS 178.An Robert Nordier Aq rnordier@FreeBSD.org . 179.Sh BUGS 180Protection mechanisms in the 181.Xr geom 4 182subsystem might prevent 183.Nm 184from being able to update the MBR on a mounted disk. 185Instructions for temporarily disabling these protection mechanisms 186can be found in the 187.Xr geom 4 188manpage. 189.Pp 190Use of the 191.Sq packet 192option may cause 193.Sq boot0 194to fail, depending on the nature of BIOS support. 195.Pp 196Use of the 197.Sq setdrv 198option with an incorrect -d operand may cause the MBR to be written 199to the wrong disk. 200Be careful! 201