From nobody Tue Sep 01 16:26:19 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hZB7b6SFQz6r6XZ for ; Tue, 01 Sep 2026 16:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hZB7b4wDbz3FTb for ; Tue, 01 Sep 2026 16:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788279979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OnNp4M/Oh0o52L+ENzMYoQSduhRL6KiKNBQdZjRjWN8=; b=Mmis8QScscThH0ALVfVUcGH+sLRTKAuJkPYA01rop+XCJeT/HvNbzD8PYvajuWQQOw3bJv fZ87PBbNTiUXbUvKcNNTjpNY1faUVc6r8IvOvTS2lP0z8rCDqmGXuKAIkBHRputTMSWM9k jakPBo+PKGS/7hDTJIrO4hP1ZkqAYhOXQaTCbDbU85qO+Zie2Z/y4dSNlh1r7LKxVrfXfx JG9NzaCksxqBYjVHdr7M32i2YI7Mrq43OTAwsuNSDWw7YyYiBfouWt3HR95SpE5qSIMKty rfnvQixoOMni1yaTHGM+uOHN8AKP1AR/0A2O25xyz0lCGva6Hkm0METlb+cb6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788279979; a=rsa-sha256; cv=none; b=YwMCc3LqETIvv+ppH3oXEYvhhdeK/xRHCjQnsgs0GstB1taIH9qceAhoyhQbIHq5GZPI22 OaABC6ajtzE0A6151b9a3YLie/VS7nURtGdelRXvCH2+x4YJcmEskd+GGUuPKEFW+VnUTf kNKd+FuR7qYSvP0BVHHThNdvfRtL3zG/edmD2hTsh9FyiqzgY/7xre+SJa6/Xu50RYUEVR WisDCVe4r4Qf90u2tNNsyF8bpd4gaZsNpk4qMIiNSqdsSODaTxZtBup4bpryDDVUyLPLcM lbGHizWG/8cizFZFzL4vv0gEVzuCql/G+57SHLuQvkqawWf3ClhoClBYfKZbXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788279979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OnNp4M/Oh0o52L+ENzMYoQSduhRL6KiKNBQdZjRjWN8=; b=tD5PTJ1Zi6vMPgwBBZIOaLywvUlfJNYowVs7o995dcslumS2hWIBo8X9hGmpw+Bo+F5Zo7 wgjvN2GMoZrl4xCq8GuY95QYf/ClTdP9GJbG9wUdMlr/KWZimv46nfHhE8s+x3J/rhjXNQ dwyMSH3SkkSMt+RqogDWjTX7V/+qwf096tEGbVUd5LA1/KldlIcKIk5ZD5aAN8+a857sCi pWHZf+MY0CHy80tiA/Mv+ekQJ/FEdKL/x/KWj3KXzQwG09xnHBfTy4hT5CIw7gAUE5O/tj 4fLSgeZQ7icgLw6vJkEX4jY5RQONaruRi8fTpFnlQgNb4IMAn97tyyzaZdjRIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hZB7b3gvMz155V for ; Tue, 01 Sep 2026 16:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32ed7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 01 Sep 2026 16:26:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a0d5b130ef81 - main - loader.kboot: Add man page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0d5b130ef8112393659b4d4300ef81e949c8618 Auto-Submitted: auto-generated Date: Tue, 01 Sep 2026 16:26:19 +0000 Message-Id: <6a96fcab.32ed7.3b65ed03@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a0d5b130ef8112393659b4d4300ef81e949c8618 commit a0d5b130ef8112393659b4d4300ef81e949c8618 Author: Warner Losh AuthorDate: 2026-09-01 14:45:54 +0000 Commit: Warner Losh CommitDate: 2026-09-01 15:58:07 +0000 loader.kboot: Add man page Sponsored by: Netflix --- stand/man/Makefile | 1 + stand/man/loader.kboot.8 | 162 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+) diff --git a/stand/man/Makefile b/stand/man/Makefile index 1075c2e831c7..a885fac69a82 100644 --- a/stand/man/Makefile +++ b/stand/man/Makefile @@ -4,6 +4,7 @@ M.${MK_EFI}+= boot1.efi.8 M.yes+= loader.8 M.${MK_EFI}+= loader.efi.8 M.${MK_FORTH}+= loader_4th.8 +M.${MK_LOADER_KBOOT}+= loader.kboot.8 M.${MK_LOADER_LUA}+= loader_lua.8 M.yes+= loader_simp.8 diff --git a/stand/man/loader.kboot.8 b/stand/man/loader.kboot.8 new file mode 100644 index 000000000000..2a7efad3252d --- /dev/null +++ b/stand/man/loader.kboot.8 @@ -0,0 +1,162 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2026 The FreeBSD Foundation +.\" +.\" 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. +.\" +.Dd September 1, 2026 +.Dt LOADER.KBOOT 8 +.Os +.Sh NAME +.Nm loader.kboot +.Nd LinuxBoot kernel loader +.Sh DESCRIPTION +.Nm +loads +.Fx +under +.Dq LinuxBoot : +a Linux kernel is used as the platform firmware, and +.Nm +runs as an ordinary Linux userland program on top of it to load the +.Fx +kernel. +It is linked statically to minimize dependencies. +.Pp +.Nm +can run at any time during the boot process as a normal program. +When running as +.Pa init +.Pq PID 1 , +.Nm +mounts +.Pa /proc , /sys , /dev +and +.Pa /tmp ; +creates the usual compatibility symlinks +.Po Pa /dev/fd , /dev/stdin , /dev/stdout , /dev/stderr Pc ; +and switches its own stdio to +.Pa /dev/console +before doing anything else. +.Nm +implements all the usual +.Fx +.Xr 8 loader +and +.Xr 8 loader_lua +features. +.Pp +.Ss Devices +Disks are accessed through their Linux +.Pa /dev +names, not the +.Fx +names: +.Pp +.Dl Ic /dev/sda: +.Dl Ic /dev/nvme0n1p3: +.Pp +The environment variable +.Va hostdisk_override +may be set, before disk probing runs, to the path of a regular file. +When unset, +.Pa /sys/block +is scanned for all available devices. +.Pp +The +.Ic host +filesystem gives access to files on the Linux host's own root filesystem, +rooted at the value of the +.Va hostfs_root +environment variable +.Pq default Dq Pa / . +Paths beginning with +.Pa /sys/ +or +.Pa /proc/ +bypass this rooting and are passed to the host unchanged, since those +are kernel-provided filesystems rather than part of any disk image. +A path starting with two slashes has one slash stripped and is otherwise +unchanged. +.Pp +.Va bootdev +selects the boot device, using the same naming as +.Va currdev . +If unset, disks and their partitions found under +.Pa /sys/block +are tried in turn, followed by any ZFS pools found on them; failing +all of that, +.Dq host:/ +is used. +.Ss Firmware tables +Since there is no direct firmware access, ACPI's RSDP and the SMBIOS +entry point are recovered from the Linux EFI system table exposed at +.Pa /sys/firmware/efi/systab , +if present. +SMBIOS data itself is read from +.Pa /sys/firmware/dmi/tables/DMI . +When those are unavailable, +.Nm +attempts to use +.Pa /dev/mem , +though that often is also unavailable. +.Ss Kernel hand-off +.Nm +uses the kexec_load feature to stage the kernel, kernel modules, +tuneables and other metadata in an intermediate buffer. +.Nm +then calls +.Fn reboot +with special arguments and he Linux kernel will then move these to the requested +location +.Pq if necessary +and jumps to the new kernel. +.Sh FILES +.Bl -tag -width /boot/loader.kboot -compact +.It Pa /boot/loader.kboot +.Nm +itself. +.It Pa /boot/lua/loader.lua +The script run by +.Nm +on startup; see +.Xr loader_lua 8 . +.El +.Sh SEE ALSO +.Xr loader 8 +.Xr loader_lua 8 +.Sh HISTORY +.Nm +first appeared in +.Fx 11.0 +as part of the PS3 port, and later generalized to several +members of the PowerPC family. +Support for aarch64 and amd64 was added in +.Fx 14.0 . +.Sh AUTHORS +.An -nosplit +.Nm +was written by +.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org . +Support was generalized by +.An Warner Losh Aq Mt imp@FreeBSD.org .