1.\" $OpenBSD: biosboot.8,v 1.17 2003/06/06 21:45:33 jmc Exp $ 2.\" 3.\" Copyright (c) 1997 Michael Shalayeff 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21.\" OR SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" SUCH DAMAGE. 26.\" 27.Dd September 1, 1997 28.Dt BIOSBOOT 8 i386 29.Os 30.Sh NAME 31.Nm biosboot 32.Nd 33i386-specific first-stage system bootstrap 34.Sh DESCRIPTION 35This small program (roughly 512 bytes of code) is responsible for 36loading the second stage 37.Xr boot 8 38program, which in turn will load the kernel. 39It takes no input or options directly. 40.Pp 41In order for 42.Nm 43to load the second-stage bootstrap, it has a table inside it which 44describes 45.Xr boot 8 's 46location. 47.Nm 48must be installed by, and have its block table filled in by, the 49.Xr installboot 8 50program. 51As this data is BIOS dependent, you must re-run 52.Xr installboot 8 53each time you reinstall 54.Xr boot 8 55or move your disk or software between machines and/or controllers. 56.Pp 57When 58.Nm 59receives control from either the BIOS or the MBR it will print the message: 60.Pp 61.Dl loading /boot 62.Pp 63followed by a dot for every successfully loaded block, 64and then put the cursor on the next line right before switching into 65protected mode and transferring control to the just loaded /boot program. 66.Sh DIAGNOSTICS 67Diagnostics consist of two error messages: 68.Bl -tag -width read_error_ 69.It Er Read error 70Some kind of error returned by the BIOS read call. 71This might be any media error, including bad sectors (common on floppy disks), 72and invalid sectors (can occur with messed up geometry translations). 73.It Er Bad magic 74The just loaded /boot image contains a bad magic in its header. 75This might indicate some kind of hardware problem, the 76.Ar boot 77argument to the 78.Xr installboot 8 79command was not a valid /boot program, or /boot has been moved or 80changed. 81.El 82.Pp 83Other common reasons for these errors to appear is that a wrong BIOS geometry 84has been used in 85.Xr installboot 8 86for the device you are booting from. 87.Sh NOTES 88The practice of making 89.Ox 90use the whole disk (ie: having 91.Nm 92as the MBR) has been deprecated, and will not work on certain BIOS versions. 93There is a lot of strange behaviour with different BIOSes; one well 94known lobotomy case is that the BIOS does not pass the right boot drive 95number to the 96.Nm 97program. 98This is one of the main reasons that having 99.Nm 100as the MBR has been deprecated. 101.Sh FILES 102.Bl -tag -width /usr/mdec/biosbootxx -compact 103.It Pa /usr/mdec/mbr 104Master Boot Record block 105.It Pa /usr/mdec/biosboot 106primary bootstrap 107.It Pa /boot 108secondary bootstrap 109.It Pa /bsd 110system code 111.El 112.Sh SEE ALSO 113.Xr boot 8 , 114.Xr boot_i386 8 , 115.Xr fdisk 8 , 116.Xr installboot 8 117.Sh HISTORY 118This program was written by Michael Shalayeff for 119.Ox 2.1 . 120However it's based on bootstrap code from older versions of this 121operating system, other operating systems, other programs, and 122other people's work. 123.Sh BUGS 124It should do a checksum over the loaded /boot image, and check that against 125a value that 126.Xr installboot 8 127has precomputed. 128.Pp 129There is no BIOS error number reported nor is the location of the error 130reported. 131.Pp 132You can pick your motherboard, and you can pick your BIOS, 133but you can't pick your motherboard's BIOS. 134