10b654f60SRobert Nordier.\" Copyright (c) 1999 Robert Nordier 20b654f60SRobert Nordier.\" All rights reserved. 30b654f60SRobert Nordier.\" 40b654f60SRobert Nordier.\" Redistribution and use in source and binary forms, with or without 50b654f60SRobert Nordier.\" modification, are permitted provided that the following conditions 60b654f60SRobert Nordier.\" are met: 70b654f60SRobert Nordier.\" 1. Redistributions of source code must retain the above copyright 80b654f60SRobert Nordier.\" notice, this list of conditions and the following disclaimer. 90b654f60SRobert Nordier.\" 2. Redistributions in binary form must reproduce the above copyright 100b654f60SRobert Nordier.\" notice, this list of conditions and the following disclaimer in the 110b654f60SRobert Nordier.\" documentation and/or other materials provided with the distribution. 120b654f60SRobert Nordier.\" 130b654f60SRobert Nordier.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND 140b654f60SRobert Nordier.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 150b654f60SRobert Nordier.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 160b654f60SRobert Nordier.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 170b654f60SRobert Nordier.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 180b654f60SRobert Nordier.\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 190b654f60SRobert Nordier.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 200b654f60SRobert Nordier.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 210b654f60SRobert Nordier.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 220b654f60SRobert Nordier.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 230b654f60SRobert Nordier.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 240b654f60SRobert Nordier.\" 2505d98029SSergey Kandaurov.Dd October 1, 2013 260b654f60SRobert Nordier.Dt BOOT0CFG 8 270b654f60SRobert Nordier.Os 280b654f60SRobert Nordier.Sh NAME 290b654f60SRobert Nordier.Nm boot0cfg 300b654f60SRobert Nordier.Nd boot manager installation/configuration utility 310b654f60SRobert Nordier.Sh SYNOPSIS 32e97407b4SRuslan Ermilov.Nm 330b654f60SRobert Nordier.Op Fl Bv 340b654f60SRobert Nordier.Op Fl b Ar boot0 350b654f60SRobert Nordier.Op Fl d Ar drive 36ae309670SLuigi Rizzo.Op Fl e Ar bell character 370b654f60SRobert Nordier.Op Fl f Ar file 38ae309670SLuigi Rizzo.Op Fl i Ar volume-id 395868a099SRobert Nordier.Op Fl m Ar mask 400b654f60SRobert Nordier.Op Fl o Ar options 4181e309b7SDavid Malone.Op Fl s Ar slice 420b654f60SRobert Nordier.Op Fl t Ar ticks 430b654f60SRobert Nordier.Ar disk 440b654f60SRobert Nordier.Sh DESCRIPTION 45b5c508fbSRuslan ErmilovThe 46b5c508fbSRuslan Ermilov.Fx 470b654f60SRobert Nordier.Sq boot0 4835213a76SDaniel Harrisboot manager permits the operator to select from which disk and 490b654f60SRobert Nordierslice an i386 machine (PC) is booted. 500b654f60SRobert Nordier.Pp 510b654f60SRobert NordierNote that what are referred to here as 520b654f60SRobert Nordier.Dq slices 530b654f60SRobert Nordierare typically called 540b654f60SRobert Nordier.Dq partitions 55753d686dSRuslan Ermilovin 56753d686dSRuslan Ermilov.No non- Ns Bx 57753d686dSRuslan Ermilovdocumentation relating to the PC. 58a9264f3eSSheldon HearnTypically, only non-removable disks are sliced. 590b654f60SRobert Nordier.Pp 600b654f60SRobert NordierThe 610b654f60SRobert Nordier.Nm 620b654f60SRobert Nordierutility optionally installs the 630b654f60SRobert Nordier.Sq boot0 640b654f60SRobert Nordierboot manager on the specified 650b654f60SRobert Nordier.Ar disk ; 660b654f60SRobert Nordierand allows various operational parameters to be configured. 670b654f60SRobert Nordier.Pp 680b654f60SRobert NordierOn PCs, a boot manager typically occupies sector 0 of a disk, which is 69*5b990a94SBaptiste Daroussinknown as the Master Boot Record (MBR). 70a9264f3eSSheldon HearnThe MBR contains both code (to which control is passed by the PC BIOS) 71a9264f3eSSheldon Hearnand data (an embedded table of defined slices). 720b654f60SRobert Nordier.Pp 730b654f60SRobert NordierThe options are: 740b654f60SRobert Nordier.Bl -tag -width indent 750b654f60SRobert Nordier.It Fl B 760b654f60SRobert NordierInstall the 770b654f60SRobert Nordier.Sq boot0 78a9264f3eSSheldon Hearnboot manager. 7935213a76SDaniel HarrisThis option causes MBR code to be replaced, without 800b654f60SRobert Nordieraffecting the embedded slice table. 810b654f60SRobert Nordier.It Fl b Ar boot0 820b654f60SRobert NordierSpecify which 830b654f60SRobert Nordier.Sq boot0 84a9264f3eSSheldon Hearnimage to use. 858aab42e1SSheldon HearnThe default is 867196870cSPoul-Henning Kamp.Pa /boot/boot0 877196870cSPoul-Henning Kampwhich will use the video card as output, alternatively 887196870cSPoul-Henning Kamp.Pa /boot/boot0sio 897196870cSPoul-Henning Kampcan be used for output to the COM1 port. 907196870cSPoul-Henning Kamp(Be aware that nothing will be output to the COM1 port unless the 917196870cSPoul-Henning Kampmodem signals DSR and CTS are active.) 920b654f60SRobert Nordier.It Fl d Ar drive 930b654f60SRobert NordierSpecify the drive number used by the PC BIOS in referencing the drive 940b654f60SRobert Nordierwhich contains the specified 950b654f60SRobert Nordier.Ar disk . 960b654f60SRobert NordierTypically this will be 0x80 for the first hard drive, 0x81 for the 970b654f60SRobert Nordiersecond hard drive, and so on; however any integer between 0 and 0xff 980b654f60SRobert Nordieris acceptable here. 99ae309670SLuigi Rizzo.It Fl e Ar bell character 100ae309670SLuigi RizzoSet the character to be printed in case of input error. 1010b654f60SRobert Nordier.It Fl f Ar file 1020b654f60SRobert NordierSpecify that a backup copy of the preexisting MBR should be written to 1030b654f60SRobert Nordier.Ar file . 10435213a76SDaniel HarrisThis file is created if it does not exist, and replaced if it does. 105ae309670SLuigi Rizzo.It Fl i Ar volume-id 106ae309670SLuigi RizzoSpecifies a volume-id (in the form XXXX-XXXX) to be saved at location 107ae309670SLuigi Rizzo0x1b8 in the MBR. This information is sometimes used by NT, XP and Vista 108ae309670SLuigi Rizzoto identify the disk drive. The option is only compatible with version 2.00 109ae309670SLuigi Rizzoof the 512-byte boot block. 1105868a099SRobert Nordier.It Fl m Ar mask 1115868a099SRobert NordierSpecify slices to be enabled/disabled, where 1125868a099SRobert Nordier.Ar mask 1135868a099SRobert Nordieris an integer between 0 (no slices enabled) and 0xf (all four slices 1145868a099SRobert Nordierenabled). 1155c95e6ffSKonstantin BelousovEach mask bit enables corresponding slice if set to 1. 1165c95e6ffSKonstantin BelousovThe least significant bit of the mask corresponds to slice 1, 1175c95e6ffSKonstantin Belousovthe most significant bit of the mask corresponds to slice 4. 1180b654f60SRobert Nordier.It Fl o Ar options 1190b654f60SRobert NordierA comma-separated string of any of the following options may be 1200b654f60SRobert Nordierspecified (with 1210b654f60SRobert Nordier.Dq no 1220b654f60SRobert Nordierprepended as necessary): 1230b654f60SRobert Nordier.Bl -tag -width indent 1240b654f60SRobert Nordier.It packet 12568c4cb5dSRuslan ErmilovUse the disk packet (BIOS INT 0x13 extensions) interface, 1261d5731beSRobert Nordieras opposed to the legacy (CHS) interface, when doing disk I/O. 1271d5731beSRobert NordierThis allows booting above cylinder 1023, but requires specific 1281d5731beSRobert NordierBIOS support. 1291d5731beSRobert NordierThe default is 13049e5f552STor Egge.Sq packet . 1310b654f60SRobert Nordier.It setdrv 132ee6fb785SRobert NordierForces the drive containing the disk to be referenced using drive 133a9264f3eSSheldon Hearnnumber definable by means of the -d option. 134a9264f3eSSheldon HearnThe default is 1350b654f60SRobert Nordier.Sq nosetdrv . 1360b654f60SRobert Nordier.It update 137a9264f3eSSheldon HearnAllow the MBR to be updated by the boot manager. 138a9264f3eSSheldon Hearn(The MBR may be updated to flag slices as 1390b654f60SRobert Nordier.Sq active , 140a9264f3eSSheldon Hearnand to save slice selection information.) 141a9264f3eSSheldon HearnThis is the default; a 1420b654f60SRobert Nordier.Sq noupdate 1430b654f60SRobert Nordieroption causes the MBR to be treated as read-only. 1440b654f60SRobert Nordier.El 14581e309b7SDavid Malone.It Fl s Ar slice 14681e309b7SDavid MaloneSet the default boot selection to 14781e309b7SDavid Malone.Ar slice . 14881e309b7SDavid MaloneValues between 1 and 4 refer to slices; a value of 5 refers to the 149a9264f3eSSheldon Hearnoption of booting from a second disk. 150f9a01458SJohn BaldwinThe special string 151f9a01458SJohn Baldwin.Dq PXE 152f9a01458SJohn Baldwinor a value of 6 can be used to boot via PXE. 153ed720ec3SRobert Nordier.It Fl t Ar ticks 1540b654f60SRobert NordierSet the timeout value to 1550b654f60SRobert Nordier.Ar ticks . 1560b654f60SRobert Nordier(There are approximately 18.2 ticks per second.) 15712b51ad0SDavid E. O'Brien.It Fl v 15812b51ad0SDavid E. O'BrienVerbose: display information about the slices defined, etc. 1590b654f60SRobert Nordier.El 160504dd5eaSRuslan Ermilov.Sh FILES 1617196870cSPoul-Henning Kamp.Bl -tag -width /boot/boot0sio -compact 162504dd5eaSRuslan Ermilov.It Pa /boot/boot0 163504dd5eaSRuslan ErmilovThe default 164504dd5eaSRuslan Ermilov.Sq boot0 165504dd5eaSRuslan Ermilovimage 1667196870cSPoul-Henning Kamp.It Pa /boot/boot0sio 1677196870cSPoul-Henning KampImage for serial consoles (COM1,9600,8,N,1,MODEM) 168504dd5eaSRuslan Ermilov.El 16959a3c79dSRuslan Ermilov.Sh EXIT STATUS 17059a3c79dSRuslan Ermilov.Ex -std 17112b51ad0SDavid E. O'Brien.Sh EXAMPLES 1724a87a5eeSJohn BaldwinTo boot slice 2 on the next boot: 17312b51ad0SDavid E. O'Brien.Pp 17405d98029SSergey Kandaurov.Dl "boot0cfg -s 2 ada0" 1754a87a5eeSJohn Baldwin.Pp 1765c95e6ffSKonstantin BelousovTo enable just slices 1 and 3 in the menu: 1774a87a5eeSJohn Baldwin.Pp 17805d98029SSergey Kandaurov.Dl "boot0cfg -m 0x5 ada0" 1792e032d8dSPav Lucistnik.Pp 1803022d78fSPav LucistnikTo go back to non-interactive booting, use 181b8c19fd7SEdward Tomasz Napierala.Xr gpart 8 1823022d78fSPav Lucistnikto install the default MBR: 1832e032d8dSPav Lucistnik.Pp 184b8c19fd7SEdward Tomasz Napierala.Dl "gpart bootcode -b /boot/mbr ada0" 1850b654f60SRobert Nordier.Sh SEE ALSO 186338465d5SScott Long.Xr geom 4 , 1870b654f60SRobert Nordier.Xr boot 8 , 188395a625cSAndrey V. Elsukov.Xr gpart 8 1890b654f60SRobert Nordier.Sh AUTHORS 19001c2b8acSBaptiste Daroussin.An Robert Nordier Aq Mt rnordier@FreeBSD.org 1910b654f60SRobert Nordier.Sh BUGS 1920b654f60SRobert NordierUse of the 1930b654f60SRobert Nordier.Sq packet 1940b654f60SRobert Nordieroption may cause 1950b654f60SRobert Nordier.Sq boot0 1960b654f60SRobert Nordierto fail, depending on the nature of BIOS support. 1970b654f60SRobert Nordier.Pp 198ee6fb785SRobert NordierUse of the 1990b654f60SRobert Nordier.Sq setdrv 200789a82a6SLuigi Rizzooption with an incorrect -d operand may cause the boot0 code 201789a82a6SLuigi Rizzoto write the MBR to the wrong disk, thus trashing its previous 202789a82a6SLuigi Rizzocontent. Be careful. 203