<commit_before>.\"	$OpenBSD: boot.8,v 1.22 2000/11/18 12:12:37 aaron Exp $
.\"
.\" Copyright (c) 1997-2000 <NAME>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"      This product includes software developed by <NAME>.
.\" 4. The name of the author may not be used to endorse or promote products
.\"    derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\" THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\"
.Dd September 1, 1997
.Dt BOOT 8 i386
.Os
.Sh NAME
.Nm boot ,
.Nm boot.conf
.Nd
i386-specific second-stage bootstrap
.Sh DESCRIPTION
The main purpose of this program is to load the system kernel while dealing
with the downfalls of the PC BIOS architecture.
.Pp
As described in
.Xr boot_i386 8 ,
this program is loaded by the
.Xr biosboot 8
primary bootstrap loader and provides a convenient way to load the kernel.
This program acts as an enhanced boot monitor for PC systems, providing
common interface for the kernel to start from.
.Pp
Basic operations include:
.Pp
.Bl -bullet -compact
.It
Detecting and switching between multiple consoles.
.It
Loading kernels from any device supported by your system BIOS.
.It
Loading kernels compressed by
.Xr gzip 1 .
.It
Passing system parameters queried from the BIOS to the kernel.
.It
Providing an interactive command line.
.El
.Pp
The sequence of its operation is as follows: initialization,
parsing the 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 variable settings (see the
.Nm set
command).
Each time a kernel load fails, the timeout is increased by one second.
The sequence of
.Nm
operations is as follows:
.Bl -enum
.It
Set up a protected mode environment which catches and reports processor
exceptions and provides a simple protected-mode BIOS interface.
.It
Probe for console devices, which includes the (default) PC VGA+Keyboard
console
.Pq Li pc0
and up to four serial consoles
.Pf ( Li com0
through
.Li com3 )
connected to the serial ports.
Display messages to the default console about the devices found.
.It
Detect memory.
Conventional memory is detected by querying the BIOS.
Extended memory is detected by probing page-by-page through the address
space, rather than asking the BIOS; many BIOS's cannot report larger than
64M of memory.
All memory found is reported to the default console device.
.It
Probe for APM support in the BIOS.
Display a message if support is present.
.It
If the file
.Pa /etc/boot.conf
exists on the filesystem
.Nm
was loaded from, open and parse it.
This file may contain any commands
.Nm
accepts at the interactive prompt.
Though default settings usually suffice, they can be changed here.
.It
The header line
.Pp
.Dl >> OpenBSD/i386 BOOT [x.xx]
.Pp
is displayed to the active console, where
.Ar x.xx
is the version number of the
.Nm
program, followed by the
.Pp
.Dl boot>
.Pp
prompt, which means you are in the interactive mode and may enter commands.
If you do not,
.Nm
will proceed loading kernel with the current parameters after the
timeout period has expired.
.El
.Sh COMMANDS
The following commands are accepted at the
.Nm
prompt:
.Bl -tag -width stty_device_speed_____
.It boot Op Ar image Op Fl abcds
Boots kernel image specified by
.Ar image
with any options given.
Image specification consists of a pair
.Em device : filename ,
either or both of each maybe omitted (':' is not needed if both are omitted),
in which case values from
.Nm
variables will be used.
.It echo Op Ar args
Displays
.Ar args
on the console device.
.It help
Prints a list of available commands and machine dependent
commands, if any.
.It machine Op Ar command
Issues machine-dependent commands.
These are defined for i386 architecture:
.Bl -tag -width diskinfo_
.It Nm diskinfo
Prints list of hard disks installed on your system including:
BIOS device number, and the BIOS geometry.
.It Nm memory
If used without any arguments this command will print out
the memory configuration as determined through BIOS routines.
Otherwise the arguments would specify the expressions to modify the
memory configuration.
The expression would have a form of:
.Pp
.Dl [+-]<size>@<address>
.Pp
Meaning to add(+) or exempt(-) the specified by the
.Ar <size>
amount of memory at the location specified by the
.Ar <address>
argument.
Both size and base address could be specified as octal,
decimal, or hexadecimal numbers, as accepted by the
.Xr stroul 3
routine.
Memory segments are not required to be adjucent to each other,
the only requirement is that there is real physical memory under
the range added.
For example:
.Bd -unfilled -offset indent
machine mem +0x2000000@0x1000000
.Ed
.Pp
would add 32M of memory right after first 16M.
The other usefull command would be to winthdraw some range
of memory form OS usage (as might be wrongfully reported as
usefull by BIOS):
.Bd -unfilled -offset indent
machine mem -0x100000@0xf00000
.Ed
.Pp
which effectively excludes 15-16M range from the map of usefull memory.
.It Nm regs
Prints contents of processor registers if compiled with
.Em DEBUG .<commit_msg>s/stroul/strtoul/; spotted by brad@<commit_after>.\"	$OpenBSD: boot.8,v 1.23 2000/11/22 20:24:09 mickey Exp $
.\"
.\" Copyright (c) 1997-2000 <NAME>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"      This product includes software developed by <NAME>.
.\" 4. The name of the author may not be used to endorse or promote products
.\"    derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\" THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\"
.Dd September 1, 1997
.Dt BOOT 8 i386
.Os
.Sh NAME
.Nm boot ,
.Nm boot.conf
.Nd
i386-specific second-stage bootstrap
.Sh DESCRIPTION
The main purpose of this program is to load the system kernel while dealing
with the downfalls of the PC BIOS architecture.
.Pp
As described in
.Xr boot_i386 8 ,
this program is loaded by the
.Xr biosboot 8
primary bootstrap loader and provides a convenient way to load the kernel.
This program acts as an enhanced boot monitor for PC systems, providing
common interface for the kernel to start from.
.Pp
Basic operations include:
.Pp
.Bl -bullet -compact
.It
Detecting and switching between multiple consoles.
.It
Loading kernels from any device supported by your system BIOS.
.It
Loading kernels compressed by
.Xr gzip 1 .
.It
Passing system parameters queried from the BIOS to the kernel.
.It
Providing an interactive command line.
.El
.Pp
The sequence of its operation is as follows: initialization,
parsing the 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 variable settings (see the
.Nm set
command).
Each time a kernel load fails, the timeout is increased by one second.
The sequence of
.Nm
operations is as follows:
.Bl -enum
.It
Set up a protected mode environment which catches and reports processor
exceptions and provides a simple protected-mode BIOS interface.
.It
Probe for console devices, which includes the (default) PC VGA+Keyboard
console
.Pq Li pc0
and up to four serial consoles
.Pf ( Li com0
through
.Li com3 )
connected to the serial ports.
Display messages to the default console about the devices found.
.It
Detect memory.
Conventional memory is detected by querying the BIOS.
Extended memory is detected by probing page-by-page through the address
space, rather than asking the BIOS; many BIOS's cannot report larger than
64M of memory.
All memory found is reported to the default console device.
.It
Probe for APM support in the BIOS.
Display a message if support is present.
.It
If the file
.Pa /etc/boot.conf
exists on the filesystem
.Nm
was loaded from, open and parse it.
This file may contain any commands
.Nm
accepts at the interactive prompt.
Though default settings usually suffice, they can be changed here.
.It
The header line
.Pp
.Dl >> OpenBSD/i386 BOOT [x.xx]
.Pp
is displayed to the active console, where
.Ar x.xx
is the version number of the
.Nm
program, followed by the
.Pp
.Dl boot>
.Pp
prompt, which means you are in the interactive mode and may enter commands.
If you do not,
.Nm
will proceed loading kernel with the current parameters after the
timeout period has expired.
.El
.Sh COMMANDS
The following commands are accepted at the
.Nm
prompt:
.Bl -tag -width stty_device_speed_____
.It boot Op Ar image Op Fl abcds
Boots kernel image specified by
.Ar image
with any options given.
Image specification consists of a pair
.Em device : filename ,
either or both of each maybe omitted (':' is not needed if both are omitted),
in which case values from
.Nm
variables will be used.
.It echo Op Ar args
Displays
.Ar args
on the console device.
.It help
Prints a list of available commands and machine dependent
commands, if any.
.It machine Op Ar command
Issues machine-dependent commands.
These are defined for i386 architecture:
.Bl -tag -width diskinfo_
.It Nm diskinfo
Prints list of hard disks installed on your system including:
BIOS device number, and the BIOS geometry.
.It Nm memory
If used without any arguments this command will print out
the memory configuration as determined through BIOS routines.
Otherwise the arguments would specify the expressions to modify the
memory configuration.
The expression would have a form of:
.Pp
.Dl [+-]<size>@<address>
.Pp
Meaning to add(+) or exempt(-) the specified by the
.Ar <size>
amount of memory at the location specified by the
.Ar <address>
argument.
Both size and base address could be specified as octal,
decimal, or hexadecimal numbers, as accepted by the
.Xr strtoul 3
routine.
Memory segments are not required to be adjucent to each other,
the only requirement is that there is real physical memory under
the range added.
For example:
.Bd -unfilled -offset indent
machine mem +0x2000000@0x1000000
.Ed
.Pp
would add 32M of memory right after first 16M.
The other usefull command would be to winthdraw some range
of memory form OS usage (as might be wrongfully reported as
usefull by BIOS):
.Bd -unfilled -offset indent
machine mem -0x100000@0xf00000
.Ed
.Pp
which effectively excludes 15-16M range from the map of usefull memory.
.It Nm regs
Prints contents of processor registers if compiled with
.Em DEBUG .
{'fraction_non_alphanumeric': 0.0587557603686636, 'fraction_numerical': 0.015053763440860216, 'mean_word_length': 3.9908010732081256, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '635161', 'n_tokens_mistral': 3844, 'n_tokens_neox': 3429, 'n_words': 2037}