1 .\" Copyright (c) 1999 Daniel C. Sobral
2 .\" All rights reserved.
3 .\" Copyright (c) 2021 Warner Losh <imp@FreeBSD.org>
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .Dd September 29, 2021
33 .Nd kernel bootstrapping final stage
39 kernel bootstrapping process.
40 It is responsible for bringing the kernel, kernel modules and other files into
44 like environment variables that are passed to the kernel.
45 It executes boot scripts written in one of several interpreters.
46 Together with the scripts, it controls the booting process and
47 interaction with the user.
49 It provides a scripting language that can be used to
50 automate tasks, do pre-configuration or assist in recovery
52 This scripting language is roughly divided in
54 The smaller one is a set of commands
55 designed for direct use by the casual user, called "builtin
56 commands" for historical reasons.
57 The main drive behind these commands is user-friendliness.
58 The larger component is the scripting language built into
61 provides three different interpreters: Forth, Lua and Simple.
62 The Forth loader is based on an ANS Forth compatible
63 Forth interpreter based on FICL, by
65 The Lua loader is a full Lua interpreter from
66 .Pa https://www.lua.org/ .
67 The Simple loader only interprets a list of builtin commands
68 without any control structure.
70 During initialization,
72 will probe for a console and set the
74 variable, or set it to serial console
76 if the previous boot stage used that.
77 If multiple consoles are selected, they will be listed separated by spaces.
78 Then, devices are probed,
85 Finally, an interpreter specific file will be executed.
87 The commands common to all interpreters are described in the
91 .Ss BUILTIN ENVIRONMENT VARIABLES
92 The environment variables common to all interpreters are described in the
94 .Dq BUILTIN ENVIRONMENT VARIABLES
113 scripting language changed to Lua by default in
120 .An Michael Smith Aq msmith@FreeBSD.org .
123 .An John Sadler Aq john_sadler@alum.mit.edu .
125 .An Warner Losh Aq imp@FreeBSD.org
126 integrated Lua into the tree based on initial work done by Pedro Souza
127 for the 2014 Google Summer of Code.