1999-03-15 08:52:23 +00:00
|
|
|
.\" Copyright (c) 1999 Daniel C. Sobral
|
|
|
|
.\" All rights reserved.
|
2021-09-29 15:21:17 +00:00
|
|
|
.\" Copyright (c) 2021 Warner Losh <imp@FreeBSD.org>
|
1999-03-15 08:52:23 +00:00
|
|
|
.\"
|
|
|
|
.\" 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.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 CONTRIBUTORS 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 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.
|
|
|
|
.\"
|
1999-08-28 01:08:13 +00:00
|
|
|
.\" $FreeBSD$
|
1999-03-15 08:52:23 +00:00
|
|
|
.\"
|
2021-09-29 15:21:17 +00:00
|
|
|
.Dd September 29, 2021
|
1999-03-15 08:52:23 +00:00
|
|
|
.Dt LOADER 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm loader
|
2000-05-18 12:44:50 +00:00
|
|
|
.Nd kernel bootstrapping final stage
|
1999-03-15 08:52:23 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The program called
|
|
|
|
.Nm
|
2000-11-14 11:20:58 +00:00
|
|
|
is the final stage of
|
|
|
|
.Fx Ns 's
|
|
|
|
kernel bootstrapping process.
|
2021-09-29 15:21:17 +00:00
|
|
|
It is responsible for bringing the kernel, kernel modules and other files into
|
|
|
|
memory.
|
|
|
|
It creates a set of
|
|
|
|
.Xr sh 1
|
|
|
|
like environment variables that are passed to the kernel.
|
|
|
|
It executes boot scripts written in one of several interpreters.
|
|
|
|
Together with the scripts, it controls the booting process and
|
|
|
|
interaction with the user.
|
1999-03-15 08:52:23 +00:00
|
|
|
.Pp
|
|
|
|
It provides a scripting language that can be used to
|
|
|
|
automate tasks, do pre-configuration or assist in recovery
|
2000-06-22 08:37:22 +00:00
|
|
|
procedures.
|
|
|
|
This scripting language is roughly divided in
|
|
|
|
two main components.
|
|
|
|
The smaller one is a set of commands
|
1999-03-15 08:52:23 +00:00
|
|
|
designed for direct use by the casual user, called "builtin
|
2000-06-22 08:37:22 +00:00
|
|
|
commands" for historical reasons.
|
2002-05-29 22:57:18 +00:00
|
|
|
The main drive behind these commands is user-friendliness.
|
2021-09-29 15:21:17 +00:00
|
|
|
The larger component is the scripting language built into
|
|
|
|
the boot loader.
|
|
|
|
.Fx
|
|
|
|
provides three different interpreters: Forth, Lua and Simple.
|
|
|
|
The Forth loader is based on an ANS Forth compatible
|
|
|
|
Forth interpreter based on FICL, by
|
1999-03-15 08:52:23 +00:00
|
|
|
.An John Sadler .
|
2021-09-29 15:21:17 +00:00
|
|
|
The Lua loader is includes a full Lua interpreter from
|
|
|
|
.Pa https://www.lua.org/ .
|
|
|
|
The Simple loader only interprets a list of builtin commands
|
|
|
|
without any control structure.
|
1999-03-15 08:52:23 +00:00
|
|
|
.Pp
|
|
|
|
During initialization,
|
|
|
|
.Nm
|
|
|
|
will probe for a console and set the
|
|
|
|
.Va console
|
|
|
|
variable, or set it to serial console
|
2005-06-14 08:49:14 +00:00
|
|
|
.Pq Dq Li comconsole
|
2000-06-22 08:37:22 +00:00
|
|
|
if the previous boot stage used that.
|
2005-05-27 19:31:00 +00:00
|
|
|
If multiple consoles are selected, they will be listed separated by spaces.
|
2000-06-22 08:37:22 +00:00
|
|
|
Then, devices are probed,
|
1999-03-15 08:52:23 +00:00
|
|
|
.Va currdev
|
|
|
|
and
|
|
|
|
.Va loaddev
|
|
|
|
are set, and
|
|
|
|
.Va LINES
|
2000-06-22 08:37:22 +00:00
|
|
|
is set to 24.
|
2021-09-29 15:21:17 +00:00
|
|
|
Finally, an interpreter specific file will be executed.
|
1999-03-15 08:52:23 +00:00
|
|
|
.Sh BUILTIN COMMANDS
|
2021-09-29 15:21:17 +00:00
|
|
|
The commands common to all interpreters are described in the
|
|
|
|
.Xr loader_simp 8
|
|
|
|
.Dq BUILTIN COMMANDS
|
|
|
|
section.
|
1999-03-15 08:52:23 +00:00
|
|
|
.Ss BUILTIN ENVIRONMENT VARIABLES
|
2021-09-29 15:21:17 +00:00
|
|
|
The environment variables common to all interpreters are described in the
|
|
|
|
.Xr loader_simp 8
|
|
|
|
.Dq BUILTIN ENVIRONMENT VARIABLES
|
2000-06-22 08:37:22 +00:00
|
|
|
section.
|
1999-03-15 08:52:23 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr libstand 3 ,
|
|
|
|
.Xr loader.conf 5 ,
|
2001-12-07 18:05:24 +00:00
|
|
|
.Xr tuning 7 ,
|
1999-03-15 08:52:23 +00:00
|
|
|
.Xr boot 8 ,
|
2021-09-29 15:21:17 +00:00
|
|
|
.Xr btxld 8 ,
|
|
|
|
.Xr loader.efi 8 ,
|
|
|
|
.Xr loader_4th 8 ,
|
|
|
|
.Xr loader_lua 8 ,
|
|
|
|
.Xr loader_simp 8
|
1999-03-15 08:52:23 +00:00
|
|
|
.Sh HISTORY
|
2002-07-14 15:19:46 +00:00
|
|
|
The
|
1999-03-15 08:52:23 +00:00
|
|
|
.Nm
|
|
|
|
first appeared in
|
|
|
|
.Fx 3.1 .
|
2021-09-29 15:21:17 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
scripting language changed to Lua by default in
|
|
|
|
.Fx 12.0 .
|
1999-03-15 08:52:23 +00:00
|
|
|
.Sh AUTHORS
|
2000-11-22 09:35:58 +00:00
|
|
|
.An -nosplit
|
2002-07-14 15:19:46 +00:00
|
|
|
The
|
1999-03-15 08:52:23 +00:00
|
|
|
.Nm
|
|
|
|
was written by
|
2000-11-22 09:35:58 +00:00
|
|
|
.An Michael Smith Aq msmith@FreeBSD.org .
|
|
|
|
.Pp
|
2021-09-29 15:21:17 +00:00
|
|
|
FICL was written by
|
1999-03-15 08:52:23 +00:00
|
|
|
.An John Sadler Aq john_sadler@alum.mit.edu .
|
2021-09-29 15:21:17 +00:00
|
|
|
.Pp
|
|
|
|
.An Warner Losh Aq imp@FreeBSD.org
|
|
|
|
integrated Lua into the tree based on initial work done by Pedro Souza
|
|
|
|
for the 2014 Google Summer of Code.
|
|
|
|
|