Reorganise and clarify the legacy role of boot1.efi in DESCRIPTION to
improve clarity.
Add a minor missing word in the BUGS section ["...caution is required*..."].
See also - PR: 290794
Signed-off-by: Aaditya Singh <aadityavksingh@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1939
SerialPort in the SPCR is zeroed when serial redirection is disabled,
rather than the SPCR being omitted from the ACPI tables ony many
systems. Check to see that SerialPort.Address is non-zero before using.
FreeBSD would fail to boot on systems that could have a serial port
redireciton, but don't have it enabled because the loader would create a
bogus hw.uart.console. While one could unset this value to boot, you
couldn't do that automatically very easily. Instead, don't even look
at the SPCR table if the SerialPort is zero'd.
PR: 292206
MFC After: 3 days
Sponsored by: Netflix
Co-authored-by: Warner Losh <imp@FreeBSD.org>
Closes: https://github.com/freebsd/freebsd-src/pull/1948
Removing the kernel from the list of available kernels is sufficient to
avoid rendering it in the list, but we need more for booting to actually
work. Notably, the 'kernel' loader.conf var was left intact to its
default value, so if one didn't use the kernel selector in the menu then
we'd try to boot the nonexistent 'kernel' instead of the new default
(first autodetected).
There's room to improve the error messages here, but for now let's just
make it actually work correctly.
PR: 292232
Fixes: d04415c520 ("loader: lua: remove the default kernel [...]")
Note that there are three variants of this MacBook. We only have the
stride and offset values for the 17" 1680x1050 model.
Reviewed by: vexeduxr
Pull Request: https://github.com/freebsd/freebsd-src/pull/1584
gfx_state.tg_private points to a EFI_GRAPHICS_OUTPUT_PROTOCOL only when
using GOP.
The firmware provided Blt functions on UGA platforms have been observed
to not work on old MacBooks, and are likley hit or miss anyways as UGA
has been deprecated since 2006.
Reviewed by: tsoome
PR: 291935
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54432
Probe for UGA instead of returning early if we can't find GOP.
Reviewed by: tsoome
PR: 291935
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54431
Fix powerpc 64 little endian booting by adding some padding. Due to
https://gitlab.com/slof/slof/-/blob/master/lib/libelf/elf32.c?ref_type=heads#L114https://gitlab.com/slof/slof/-/blob/master/lib/libelf/elf32.c?ref_type=heads#L150
using <= instead of <, slof used to loop over the phdrs. It overruns by
1 and so on little endian it swizzles the first 32 bytes of .text. Work
around this by adding 32 bytes of padding after the headers. We should
fix this in slof, but it's in the just released QEMU 10.2, so we have to
pad things here for now.
Now powerpc64le + qemu works.
MFC After: 3 days (maybe EN too)
Reviewed by: adrian, jhibbits
Sponsored by: Netflix
When looking for the boot_params symbol we need to get the UEFI memory
map, use host: prefix. The short-circuit we have for this only works
when we have a filesystem. During the earliest parts of boot, we can
sometimes not have this yet, so making this explicit allows these
environments to function.
It's always in the host path. Print better
error messages, and add newlines in two palces.
Sponsored by: Netflix
When migrating the firmware to be installed as plain firmware files
to /boot/firmware the iwm8000C firmware lost its "fw" suffix that
iwm(4) expects.
The follow-up change to defaults/loader.conf is also consistently
missing the "fw".
Fix both places, and add the wrongly spelt version to ObsoleteFiles.inc
(entirely untested).
PR: 291403
Reported by: Augustin Hoffmann (avgwst tutanota.de)
Fixes: af0a81b647
Fixes: a0f06dfb0d
MFC after: 3 days
Some time ago, the boot loader stopped polling for a key press during
the kernel and module loading prior to the transition to lua. Inspection
of the code shows the polling is no longer there. Document the change.
Sponsored by: Netflix
ZFSSRC is abiguous on its surface and too clos to ZFSTOP, so rename it
to SAZFSSRC.
Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D53901
Use ZFSTOP instead of OZFS. They are the saame thing.
Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D53900
- Add several missing .Pp after lists and literal blocks.
- Fix the column widths for the console table and use a shorter indent
so that it doesn't wrap on an 80-col display.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D53866
Update to include the right includes for the riscv protocol to get the
hypervisor details.
Note: I expanded the GUID inline rather than using a #define because
there was none. This is only listed in UefiCpuPkg/UefiCpuPkg.dec, so
include it here inline until we can automate using those files.
Fixes: 43b8edb320
Sponsored by: Netflix
x86 doesn't use FDT things by default, but aarch64 does. I thought I'd
built the loader on aarch64 to test the EDK2 all the things series, but
apparently not. This fixes the aarch64 build.
Fixes: 43b8edb320
Sponsored by: Netflix
Remove the old EFI SDK files that we've been nursing along for too many
years. Replace them with files from EDK2 edk2-stable202502 and tweak the
interfaces we need to tweak. Mostly include different things or change
the names of the protocols that no longer have old-school compat names.
I gave up in the middle of env.c, too damn tedious to find all those new
GUIDs. Also, many of the guids were mystery meat, most likely from the
EDK2 sources, but just not the Include subdirectory. Need to investigate
those. And the memory info? Is it just an oboslete thing, or embedded
knowledge of EDK2.
Delete the now-redundant copies of things in Guid and Protocol. I
debated keeping ZeroGuid.h, but EDK2 has moved on from when I snagged it
years ago (or maybe I just invented it out of whole cloth: edk2 does
radically different things today and I didn't do the git deep-dive to
find out).
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D53655
Begin documenting module loader commands in loader(8), where the reader
would look for them. Segregate them by their availability in individual
loader implementations, like build(7) targets.
These details were graciously donated by kevans.
MFC after: 3 days
Reviewed by: kevans
Co-authored-by: Kyle Evans <kevans@freebsd.org>
Differential Revision: https://reviews.freebsd.org/D50727
console=comconsole is for the loader and boot_serial is for the kernel.
I think we should centralize documentation on the loader settings in one
manual, such a loader.8. The current proliferation is not obvious where
to find the documentation. To the user, these are all set in loader.conf
or at the loader prompt.
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53695
There is a pool feature, dynamic_gang_header, that is enabled by default
in new pools. When this feature is active, gang headers may be larger
than 512 bytes. The loader needs to be taught to cope with that.
Try using the vdev ashift to pick the gang block header size. If the
checksum fails, fall back to the old gang block header size.
This is based on a patch by Paul Dagnelie, with testing, bug-fixing and
some simplifications from me.
PR: 289690
Co-authored by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53578
Currently, files in /boot (other than /boot/kernel) are assigned to the
bootloader package using a filename match in mtree-to-plist.awk. This
causes some problems, most notably that debug info for userboot ends up
in the utilities-dbg package instead of bootloader-dbg.
Remove the path handling from mtree-to-plist and instead set PACKAGE
in the appropriate Makefiles to put these in the correct package.
While here, move userboot*.so from bootloader-dev to bootloader.
MFC after: 3 days
Reviewed by: cperciva
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53179
The reimplementation is a bit cleaner than the original code,
although it is also slightly slower. This shouldn't matter too
much as we will have asm code for the major platforms.
The code is unrolled when built in the kernel or user space, but
not when in libsa, as to reduce the code size.
Differential Revision: https://reviews.freebsd.org/D45670
Reviewed by: jrtc27, imp
Approved by: markj (mentor)
MFC after: 1 month
Both files are used by kernel and userspace.
Move them to sys/crypto where they belong.
No functional changes intended.
In preparation of D45670.
Reviewed by: markj
Approved by: markj (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D52909
GCC has started to warn about memory accesses under address 0x1000.
Tweak it to 0x400 for stand/i386 to avoid warnings for access to BIOS
data area memory and above but still retain most of the warning value.
Reviewed by: dab, imp
Differential Revision: https://reviews.freebsd.org/D53036
What we really want here is to know if pointers can refer to 64-bit
addresses, regardless of whether they also hold other information (such
as capabilities in CHERI). __SIZEOF_SIZE_T__ is probably the closest
indication to that piece of information, so let's use it. __ILP32__
wasn't wrong in practice though, as we don't support 32-bit CHERI
hardware (and likely never will).
Consistently with this change, test whether we can actually address the
64-bit SMBIOS's structure table by converting the end address to
'size_t' and checking whether its value is preserved.
Suggested by: jhb (for the __ILP32__ => __SIZEOF_SIZE_T__ part)
Reviewed by: jhb, imp
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49318
Bootstrap flua has some magic now to handle modules by building them in
and discovering them via linker sets. This is slightly cleaner than
always building them in and baking them into loadedlibs for both
bootstrap and system flua.
Adjust the stand build now that these three libs have their own new
homes.
Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D51891
Bootstrap flua has some magic now to handle modules by building them in
and discovering them via linker sets. This is slightly cleaner than
always building them in and baking them into loadedlibs for both
bootstrap and system flua.
Adjust the stand build now that these three libs have their own new
homes.
Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D51891
While boot_single:lower() should always be in {yes,no}, it might not
be. In one place we check == yes, and another ~= no. Make both places ~=
no for consistency. We generally try to test != default.
Sponsored by: Netflix
Remove 'pager' shim that was last not supported in FreeBSD 12.2, which
went EOL on March 31, 2022. People have had enough time to upgrade the
boot loader.
Sponsored by: Netflix
StartImage() may return additional data from failure. This data
has text message followed by optional binary blob. Print
out the text message (if present) and free the data.
See 7.4.2 EFI_BOOT_SERVICES.StartImage() page 199
UEFI_Spec_Final_2.11.pdf.
Reviewed by: imp
Also return actual errno values in other code paths.
(suggested by tsoome)
Reviewed by: tsoome, imp
Differential Revision: https://reviews.freebsd.org/D52432