From nobody Tue Sep 01 16:26:19 2026 X-Original-To: dev-commits-src-all@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 4hZB7h6Jg2z6r6gb for ; Tue, 01 Sep 2026 16:26:24 +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 4hZB7h5Dp1z3FCr for ; Tue, 01 Sep 2026 16:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788279984; 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=bwZekZAbt8qu9mFP6mt2Xk9X3ZsLIEY4eNnRIebq/wLQklB/qCGRtdSozCOlMn7UlbWqQ3 HHxW3NodAwmHri643xwn5Alh92Edt6XnA/5jLtGDQF9+m9ewXS+edhHrdquKZimS/mf8YE Ubk9MNB0lumsHhdpdJ6D17Bb10h4/8sPs7M0E74TpSs8VXUGyc8M0N/I5Rk96a8oY6+LGR qMs2030EqQgh3mmCnP+JyIo+TsE+yewGTt4nY4HSe5ZTcTQM/WKDI/Pf0VkgdkT/5lLhxk v8/z/RsLtsCuy0l8H+7KNmmeYEjpZ0F3IPt/f4W3tjhDPS4Fn2NxiE15sU39sA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788279984; a=rsa-sha256; cv=none; b=mI7u57baINK4Gcj1PDx4q54Y/MXODopk05Q1IPpFxKb1oU8Mo3q9vVlKJG4y+KaXD1Q8Gi vxUPUXF3r5F4ZXquVO4Eg1b5cgCKCYPcZ9Zd8hGJYHQSAGVFAn34clTxKBz32ZaYTBzS0r ESwPkjoUhy3CpASeplmj9bc3UlGP/uePv/P53zBSiwAXsB7Z/xhlcFkfDR3xvAK/a8NjuQ LfucV7DkvJ9f76qZ7zcD7qMnE7oMJx+buB+1eVei4hhG12xUdltBWJXOQauiwoH8+l1ANL cvlBHShu0uC9Z/OEEwbFNSpcmMtJ22NDcFzeB555gQXnC69RmbT+TqZ7DhZ4RQ== 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=1788279984; 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=CjeM2L1RIa1mGYMq6p3627pzGOWKyrSvQU1C6AD57ebVEu7wR2TEqatGL9u3FDIk7sK6Mc +NoTjpfNP/CYjSSRHs5Jd0weZmtDqX+YL7aEbBEZLslnWWWZjW3tNjtkZd3tTXA7vuibXP 7wYY2MEhtE3a4b/3rdItc7vCHPN6daLbzA36FtZjvRqpBzE4+EUiJKPvMyDC0PdKt8Iy+5 WFllzQBjQdtzU9f9orgdllALY2IlwHzIWSDzpyDum3EweXWyFvJRMxzJqdT+qaFat52KKt n5o4KXF/7U03fk150fVgSgn2SkKbjdKElbDkGacFLGRhgdmcAWPBvvQcT1cYtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hZB7h3s2Pz15J8 for ; Tue, 01 Sep 2026 16:26:24 +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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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 .