boot, boot.conf - i386-specific second-stage bootstrap
The main purpose of this program is to load the system kernel while dealing
with the downfalls of the PC BIOS architecture.
As described in boot_i386(8), this program is loaded by the
primary bootstrap loader and provides a convenient way to
load the kernel.
This program acts as an enhanced boot monitor for PC
a common interface for the kernel to start from.
Basic operations include:
+o Detecting and switching between multiple consoles.
+o Loading kernels from any device supported by your system
+o Loading kernels compressed by gzip(1).
+o Passing system parameters queried from the BIOS to the
+o Providing an interactive command line.
The sequence of its operation is as follows: initialization,
configuration file, then an interactive command line. While
at the command
line you have 5 seconds to type any commands, if needed. If time
expires, the kernel will be loaded according to the current
(see the set command). Each time a kernel load fails,
is increased by one second. The sequence of boot operations
is as follows:
1. Set up a protected mode environment which catches and
exceptions and provides a simple protected-mode
2. Probe for console devices, which includes the (default)
console (pc0) and up to four serial consoles
com3) connected to the serial ports. Display messages
to the default
console about the devices found.
3. Detect memory. Conventional memory is detected by
BIOS. Extended memory is detected by probing page-bypage through
the address space, rather than asking the BIOS; many
report larger than 64M of memory. All memory found is
the default console device.
4. Probe for APM support in the BIOS. Display a message
if support is
5. If the file /etc/boot.conf exists on the filesystem
boot was loaded
from, open and parse it. This file may contain any
accepts at the interactive prompt. Though default settings usually
suffice, they can be changed here.
6. The header line
>> OpenBSD/i386 BOOT [x.xx]
is displayed to the active console, where x.xx is the
of the boot program, followed by the
prompt, which means you are in interactive mode and may
If you do not, boot will proceed to load the
kernel with the
current parameters after the timeout period has expired.
By default, boot attempts to load the kernel executable
/bsd. If that
fails, it will attempt to load /obsd and then /bsd.old. If
it fails to
find any of these files, and no alternative kernel image has
the system will be unable to boot.
The following commands are accepted at the boot prompt:
boot [image [-acds]]
Boots the kernel image specified by image with any
Image specification consists of a pair
or both can be omitted (`:' is not needed if
both are omitted),
in which case values from boot variables will
When selecting the device to boot from, boot makes
between SCSI and IDE type drives; they are detected as `hd'
devices. Therefore, to boot kernel /bsd from slice
`a' on the
first hard drive (irrespective of device type),
-a Causes the kernel to ask for the root device
-c Causes the kernel to go into boot_config(8)
-d Causes the kernel to drop into ddb(4) at the
-s Causes the kernel to boot single-user.
Displays args on the console device.
help Prints a list of available commands and machine dependent commands,
Issues machine-dependent commands. These are defined for i386
diskinfo Prints a list of hard disks installed on
including: BIOS device number, and the
memory If used without any arguments this command will print
out the memory configuration as determined through
BIOS routines. Otherwise the arguments
the expressions to modify the memory configuration.
The expression would have a form of:
Meaning to add(+) or exempt(-) the specified by the
<size> amount of memory at the location
the <address> argument. Both size and
could be specified as octal, decimal, or
numbers, as accepted by the strtoul(3)
segments are not required to be adjacent to each
other, the only requirement is that there
physical memory under the range added.
machine mem +0x2000000@0x1000000
would add 32M of memory right after the
The other useful command would be to
withdraw a range
of memory from OS usage (might be wrongfully reported
as useful by the BIOS).
machine mem -0x100000@0xf00000
which effectively excludes 15-16M range
from the map
of useful memory.
regs Prints contents of processor registers if
Prints contents of the specified directory in long
attributes and file type, owner, group,
reboot Reboots the machine by initiating a warm boot procedure.
set [varname [value]]
If invoked without arguments, prints a list of
their values. If only varname is specified, displays contents
of that variable. If varname and value are both
that variable to the given value. Variables include:
addr Address at which to load the kernel.
debug Debug flag if boot was compiled with DEBUG
device Boot device name (e.g., fd0a, hd0a).
howto Options to pass to the loaded kernel.
image File name containing the kernel image.
timeout Number of seconds boot will wait for human
before booting the default kernel image.
tty Active console device name (e.g., com0,
Currently, only the first serial port
(com0) is supported
for console on i386.
stty [device [speed]]
Displays or sets the speed for a console device.
the baudrate for the currently active console, boot
five seconds of grace time before committing the
change to allow
you to change your terminal's speed to match. If
not for the active console, the baudrate is set for
time you switch to a serial console. The baudrate
value is not
used for the pc0 console.
The default baudrate is 9600bps.
time Displays system time and date.
/usr/mdec/biosboot first stage bootstrap
/usr/mdec/pxeboot PXE bootstrap
/boot system bootstrap
/etc/boot.conf system bootstrap's startup file
/bsd kernel image
Boot the default kernel:
Remove the 5 second pause at boot-time permanently, causing
boot to load
the kernel immediately without prompting:
# echo "boot" > /etc/boot.conf
Use serial console. A null modem cable should connect the
port to a terminal. Useful for debugging.
boot> set tty com0
Invoke the serial console at every boot:
# echo "set tty com0" > /etc/boot.conf
Boot the kernel named /bsd from the second hard disk in
Configuration'' mode (see boot_config(8)). This mechanism
allows for the
explicit enabling and disabling of devices during the current boot sequence,
as well as the modification of device parameters.
such changes can be made permanent by using config(8)'s -e
boot> boot hd1a:/bsd -c
gzip(1), autoconf(4), ddb(4), biosboot(8), boot_config(8),
fdisk(8), installboot(8), pxeboot(8), reboot(8)
RFC 1950 describes the zlib library interface.
The official home page for the version of zlib used in this
system is at http://quest.jpl.nasa.gov/zlib/.
This program was written by Michael Shalayeff for OpenBSD
OpenBSD 3.6 September 1, 1997
[ Back ]