xref: /freebsd/stand/man/loader.kboot.8 (revision 68a4a53e82afb51dedda7893673d119e172bf520)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2026 Netflix, Inc.
5.\"
6.\"
7.Dd September 1, 2026
8.Dt LOADER.KBOOT 8
9.Os
10.Sh NAME
11.Nm loader.kboot
12.Nd LinuxBoot kernel loader
13.Sh DESCRIPTION
14.Nm
15loads
16.Fx
17under
18.Dq LinuxBoot :
19a Linux kernel is used as the platform firmware, and
20.Nm
21runs as an ordinary Linux userland program on top of it to load the
22.Fx
23kernel.
24It is linked statically to minimize dependencies.
25.Pp
26.Nm
27can run at any time during the boot process as a normal program.
28When running as
29.Pa init
30.Pq PID 1 ,
31.Nm
32mounts
33.Pa /proc , /sys , /dev
34and
35.Pa /tmp ;
36creates the usual compatibility symlinks
37.Po Pa /dev/fd , /dev/stdin , /dev/stdout , /dev/stderr Pc ;
38and switches its own stdio to
39.Pa /dev/console
40before doing anything else.
41.Nm
42implements all the usual
43.Fx
44.Xr 8 loader
45and
46.Xr 8 loader_lua
47features.
48.Pp
49.Ss Devices
50Disks are accessed through their Linux
51.Pa /dev
52names, not the
53.Fx
54names:
55.Pp
56.Dl Ic /dev/sda:
57.Dl Ic /dev/nvme0n1p3:
58.Pp
59The environment variable
60.Va hostdisk_override
61may be set, before disk probing runs, to the path of a regular file.
62When unset,
63.Pa /sys/block
64is scanned for all available devices.
65.Pp
66The
67.Ic host
68filesystem gives access to files on the Linux host's own root filesystem,
69rooted at the value of the
70.Va hostfs_root
71environment variable
72.Pq default Dq Pa / .
73Paths beginning with
74.Pa /sys/
75or
76.Pa /proc/
77bypass this rooting and are passed to the host unchanged, since those
78are kernel-provided filesystems rather than part of any disk image.
79A path starting with two slashes has one slash stripped and is otherwise
80unchanged.
81.Pp
82.Va bootdev
83selects the boot device, using the same naming as
84.Va currdev .
85If unset, disks and their partitions found under
86.Pa /sys/block
87are tried in turn, followed by any ZFS pools found on them; failing
88all of that,
89.Dq host:/
90is used.
91.Ss Firmware tables
92Since there is no direct firmware access, ACPI's RSDP and the SMBIOS
93entry point are recovered from the Linux EFI system table exposed at
94.Pa /sys/firmware/efi/systab ,
95if present.
96SMBIOS data itself is read from
97.Pa /sys/firmware/dmi/tables/DMI .
98When those are unavailable,
99.Nm
100attempts to use
101.Pa /dev/mem ,
102though that often is also unavailable.
103.Ss Kernel hand-off
104.Nm
105uses the kexec_load feature to stage the kernel, kernel modules,
106tuneables and other metadata in an intermediate buffer.
107.Nm
108then calls
109.Fn reboot
110with special arguments and he Linux kernel will then move these to the requested
111location
112.Pq if necessary
113and jumps to the new kernel.
114.Sh FILES
115.Bl -tag -width /boot/loader.kboot -compact
116.It Pa /boot/loader.kboot
117.Nm
118itself.
119.It Pa /boot/lua/loader.lua
120The script run by
121.Nm
122on startup; see
123.Xr loader_lua 8 .
124.El
125.Sh SEE ALSO
126.Xr loader 8
127.Xr loader_lua 8
128.Sh HISTORY
129.Nm
130first appeared in
131.Fx 11.0
132as part of the PS3 port, and later generalized to several
133members of the PowerPC family.
134Support for aarch64 and amd64 was added in
135.Fx 14.0 .
136.Sh AUTHORS
137.An -nosplit
138.Nm
139was written by
140.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org .
141Support was generalized by
142.An Warner Losh Aq Mt imp@FreeBSD.org .
143