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