Commit Graph

2057 Commits

Author SHA1 Message Date
Warner Losh
780f289297 stand: drop inttypes.h from safe list
Nothing uses it anymore, so drop it from the 'safe' list. Also, move
stand/efi/loader/main.c to using machine/_inttypes.h which is all it
really needs.

Sponsored by:		Netflix
2024-11-20 12:49:48 -07:00
Warner Losh
17be774ee7 stand: unistd.h is no longer safe
unistd.h includes too much extra stuff for the boot loader. This creates
a fair amount of namespace pollution and it's best to just make it an
alias for stand.h like the other include files already are.

Sponsored by:		Netflix
2024-11-19 20:35:04 -07:00
Warner Losh
c29cba408d stand: Narrow the 'signal emulation' we provide
We only need to provide sig_atomic_t in emulation. However, including
machine/signal.h brings in too much namespace pollution related to
signals. Instead, define sig_atomic_t as long. Setting long is async
atomic on all platforms (though powerpc64 defines it to an int), though
that doesn't matter since the boot loader doesn't use signals.

Sponsored by:		Netflix
2024-11-19 20:24:41 -07:00
Graham Percival
bc919e81e0 man: Misc syntax fixes
- loader.efi.8: use proper way of printing a backslash.
- usr.bin/gzip/gzip.1: contained a non-breaking space (in utf-8, 0xC2A0).
- lib/libpmc/pmc.*.3: remove two duplicate .Xr lines

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1523
2024-11-14 16:59:22 -04:00
Warner Losh
7e8f87ca2b loader: Don't need the arch list
MK_LOADER_KBOOT is already marked broken for these architectures, so I
don't need an if too.

Sponsored by:		Netflix
2024-11-12 22:01:24 -07:00
Ed Maste
3750ccefb8 Retire MK_PROFILE infrastructure
It was disabled by default in fe52b7f60e.  We planned to (but did not)
remove the option before FreeBSD 14.  Remove it now, for FreeBSD 15.

Relnotes:	Yes
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31558
2024-11-12 12:11:51 -05:00
Warner Losh
d2434697bc loader.kboot: Build on amd64
But comment out FDT stuff for amd64 built inside kboot. This also
restricts a bit the powerpc platforms we build on to powerpc64.

Sponsored by:		Netflix
2024-11-07 16:23:26 -07:00
Graham Percival
c7c3ef8949 manuals: Remove trailing spaces
Some checks are pending
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /opt/homebrew/opt/llvm@18/bin, macos-latest, bmake libarchive llvm@18, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /opt/homebrew/opt/llvm@18/bin, macos-latest, bmake libarchive llvm@18, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /usr/lib/llvm-18/bin, ubuntu-24.04, bmake libarchive-dev clang-18 lld-18, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /usr/lib/llvm-18/bin, ubuntu-24.04, bmake libarchive-dev clang-18 lld-18, arm64, aarch64) (push) Waiting to run
This does not change the rendered ascii at all.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1473
2024-11-04 11:26:14 -04:00
Tatiana
47ef2a1310 loader.efi: Fix LOADER_NET_SUPPORT=no builds
Some checks are pending
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /opt/homebrew/opt/llvm@18/bin, macos-latest, bmake libarchive llvm@18, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /opt/homebrew/opt/llvm@18/bin, macos-latest, bmake libarchive llvm@18, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /usr/lib/llvm-18/bin, ubuntu-24.04, bmake libarchive-dev clang-18 lld-18, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-18, /usr/lib/llvm-18/bin, ubuntu-24.04, bmake libarchive-dev clang-18 lld-18, arm64, aarch64) (push) Waiting to run
We include too many references to networking things in the
non-networking build for loader.efi. Ifdef out netserver command when we
are disabling network support to resolve.

PR: 277528
MFC After: 2 days
Reviewed by: imp
2024-11-02 16:13:58 -06:00
Warner Losh
c2ba66d4d0 loader: Fix boot menu on BIOS
Only the gfx-enabled boot loader supports unicode. Otherwise, we have to
use the old cons25 / ibmpc upper code page drawing characters. Check to
see if we have the gfx.term_drawbox function. If we do, we support the
unicode drawing characters. If we don't, then we have an older loader
that doesn't support it *OR* we have the reduced function, text-only
boot loader. In either of those cases, we need to use the old graphics
characters. Abstract all those details into core.hasUnicode function.

PR: 282465
MFC After: 2 day
Sponsored by: Netflix
Differential Revision:	https://reviews.freebsd.org/D47403
2024-11-02 16:02:44 -06:00
Warner Losh
10c429016a stand: Ugly hack due to default change
So this is a gross hack to fix the 'noclean' build since we changed to
text-only loader. We have to fix it in a better way, but for the moment,
this will fix non-meta no-clean builds. A better hack is to fix this so
we build either vidconsole.c or textvidc.c, but some minor refactoring
and variable renaming is needed.

Fixes:			23dee252da
Sponsored by:		Netflix
2024-10-28 13:51:53 -06:00
Graham Percival
759ddb4d24 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1472
2024-10-28 12:26:03 -03:00
Warner Losh
358752abdf loader/loader.mk: add docs for LOADER_*_SUPPORT variables
These are internal to the loader and generally can only be set in a
makefile that's compiling some variation of loader. Add caveats since
these aren't really user-serviceable parts, though some downstreams will
tweak individual makefiles for their own purposes.

Sponsored by:		Netflix
2024-10-24 20:26:26 -06:00
Warner Losh
23dee252da loader: Change this BIOS tradeoff: Add back zip and use text only
After talking with a number of people about the removal of some things
to make the loader fit, readjust things a little.

Add back GZIP and BZIP2 compression support. Many of the downstream MFC
packaging systems depend on this. This adds back 20k to the size of the
loader.

Make the boot loader text-only by default. This saves 40k in size. Net,
we're 20k smaller. The graphics loader for BIOS is less useful than the
zip functionality: You can still boot w/a text only one it and you can
build a custom one if you really want it. It's also the default we use
for dual console.

This should be merged back into stable/14 and stable/13 so it's in the
next release for each of these. That way we have only one release (13.4)
with the other defaults.

MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:		olce, rgrimes, emaste
Differential Revision:	https://reviews.freebsd.org/D47203
2024-10-24 20:26:25 -06:00
Li-Wen Hsu
dab59af3bc
Canonicalize the name of the FreeBSD Foundation
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2024-10-24 05:03:07 +08:00
Warner Losh
ef48b2954e stand: Fix defaults file
Currently, quotes in a comment lead to mal-formed lines warnings. Remove
the quotes since it doesn't matter. The underlying bug likely should be
fixed, but since stability week is neigh, workaround this.

Fixes:			7df3e400ea
Sponsored by:		Netflix
Reviewed by:		bcran
Differential Revision:	https://reviews.freebsd.org/D47201
2024-10-19 12:53:41 -06:00
Graham Percival
229381deb2 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1459
2024-10-15 17:20:47 -03:00
Warner Losh
501983e62e loader.efi: Parse SPCR v3 and v4
We can get the UART clock from v3 SPCR, and a precise baudrate from
v4. Some precise baudrates will currently be rejected by the kernel.

Sponsored by:		Netflix
Reviewed by:		adrian, andrew
Differential Revision:	https://reviews.freebsd.org/D47096
2024-10-15 05:12:59 -06:00
Warner Losh
70253b538f loader.efi: Parse SPCR table entry in ACPI tables
If there's a SPCR, then use it to create and pass the right values to
the uart.  We pass xo=0 in to calcuate the xo from the baud rate. We try
to be smart about what we set. We either set io or mm or pv/pd. Old
kernels will still work, despite pb/pd not being supported, because
we'll fall back to the SPCR parsing in the kernel.

We don't support Rev3 or Rev4 SPCR yet. It's too new to be in real
hardware yet.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D47085
2024-10-15 05:12:16 -06:00
Warner Losh
94164106c0 loader.efi: |= the boot flags how
how is assumed to be 0, so we directly assign to it. It might not always
be 0, so or-in these bits.

Sponsored by:		Netflix
Reviewed by:		bz, andrew
Differential Revision:	https://reviews.freebsd.org/D47084
2024-10-15 05:11:02 -06:00
Warner Losh
c5f3a7f622 loader.efi: Make rsdp global
Make rsdp pointer to the RSDP global so we can look up other tables.

Sponsored by:		Netflix
Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D47083
2024-10-15 05:10:27 -06:00
Emmanuel Vadot
7df3e400ea loader: default: Add a default splash screen
Setting boot_mute="YES" currently use the in-kernel black and white logo.
Instead default to the color png one.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-10-14 11:27:41 +02:00
Warner Losh
37798b1d5d loader/4th: Move from hint.acpi.0.rsdp to acpi.rsdp
Use acpi.rsdp to test for ACPI. 4th wasn't updated with the old compat
was dropped a while ago.

MFC After:	1 week
Sponsored by:	Netflix
2024-10-11 15:40:53 -06:00
Warner Losh
baa7e9cd30 loader: Use Cyan instead of Blue for some menu items
BLUE often translates to DARK BLUE. On BLACK this is hard to
read. Instead, use CYAN which looks good on both black and white
backgrounds.

Discussed with: kevans
Sponsored by: Netflix
2024-10-11 15:27:46 -06:00
Justin Hibbits
f2e62e6013 loader/powerpc: Add some CAS support for newer POWER CPUs
* Add PVR bits for POWER10 and POWER11
* Initialize the `err` outvar, in case it's not touched on success by
  the hypervisor, to prevent spurious errors.
2024-10-11 17:17:43 -04:00
Martin Matuska
7a7741af18 zfs: merge openzfs/zfs@b10992582
Notable upstream pull request merges:
 #9416  -multiple zio_compress: introduce max size threshold
 #10018 a10e552b9 Adding Direct IO Support
 #15147 e419a63bf xattr dataset prop: change defaults to sa
 #15454 7e957fde7 send/recv: open up additional stream feature flags
 #15810 0d77e738e Defer resilver only when progress is above a threshold
 #15921 3cf2bfa57 Allocate zap_attribute_t from kmem instead of stack
 #16483 -multiple dmu_objset: replace dnode_hash impl with cityhash4
 #16485 8be2f4c3d zio_resume: log when unsuspending the pool
 #16491 88433e640 sys/types32.h: Remove struct timeval32 from libspl header
 #16496 f245541e2 zfs_file: implement zfs_file_deallocate for FreeBSD 14
 #16511 308f7c2f1 Fix an uninitialized data access
 #16529 29c9e6c32 Fix handling of DNS names with '-' in them for sharenfs
 #16531 ddf5f34f0 Avoid fault diagnosis if multiple vdevs have errors
 #16539 6f50f8e16 zfs_log: add flex array fields to log record structs
 #16546 d40d40913 Evicting too many bytes from MFU metadata
 #16551 3014dcb76 Reduce and handle EAGAIN errors on AIO label reads
 #16554 80645d658 FreeBSD: restore zfs_znode_update_vfs()
 #16565 832f66b21 FreeBSD: Sync taskq_cancel_id() returns with Linux
 #16567 48d1be254 Properly release key in spa_keystore_dsl_key_hold_dd()
 #16569 141368a4b Restrict raidz faulted vdev count
 #16583 c84a37ae9 lua: add flex array field to TString type
 #16584 86737c592 Avoid computing strlen() inside loops
 #16587 d34d4f97a snapdir: add 'disabled' value to make .zfs inaccessible
 #16593 224393a32 feature: large_microzap
 #16597 412105977 Temporarily disable Direct IO by default
 #16605 4ebe674d9 ARC: Cache arc_c value during arc_evict()

Backported pull request merges:
 #16613 ab777f436 Return boolean_t in inline functions of
                  lib/libspl/include/sys/uio.h
 #16616 efeb60b86 FreeBSD: ignore some includes when not building kernel
 #16635 ---TBD--- zdb: fix printf format in dump_zap()

Obtained from:	OpenZFS
OpenZFS commit:	b109925820
OpenZFS tag:	2.3.0-rc1
2024-10-11 08:43:49 +02:00
Toomas Soome
fae4b97c1a loader: reading from large dosfs fails
With 8GB disk image and FAT32, our read offset calculation wraps over
32-bit integer and we end up reading garbage. The problem appears when
disk image is filled with data and the block to bytes translations do
not fit into 32-bit integers.

illumos issue: https://www.illumos.org/issues/16666

Sponsored by:	MNX Cloud, Inc.
MFC after:	1 week
2024-10-10 11:40:25 +03:00
Graham Percival
643fc69820 manuals: Fix "missing end of block" errors
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1454
2024-10-08 16:14:49 -03:00
Toomas Soome
79a0d14fa0 loader: dosfs fails to access directory data with large cluster number
fsize is using 2 bytes for cluster number, but with fat32 we
actually do have 4 bytes and with large disks the high bytes will be in use.

illumos issue: https://www.illumos.org/issues/16821

Sponsored by:	MNX Cloud, Inc.
MFC after:	1 week
2024-10-03 16:51:59 +03:00
Tatsuki Makino
4fa4693dcd btx: Align the PXE prompt with other options
To fit within in the same space, drop the newline before the PXE
prompt to make room for the additional space character.

PR:		281494
2024-09-30 15:41:42 -04:00
Kyle Evans
e7a629c851 libmd, kern, stand: consolidate md5 implementations (NFC)
Reduce the number of md5c.c between the three of these from two to one
by just reaching into the kernel build for both userland builds.  The
precedent for this already exists for sha2 in both cases.

_libmd_ symbol privatization bits have been moved to sys/md5.h and
md5.h remains to #include <sys/md5.h> for compatibility.

This stops exporting MD5Pad() in the process because the kernel stopped
exporting it in 502a35d60f.  soversion is bumped accordingly.

This also renames the libc version of stack_protector.c; it previously
only worked by coincidence because .PATH ordering worked out such that
we got the right one, but this is not the case anymore.  Remove the
landmine.

PR:		280784 (exp-run)
Reviewed by:	allanjude, delphij
Differential Revision:	https://reviews.freebsd.org/D34497
2024-09-29 22:34:18 -05:00
Warner Losh
604919c47f loader: Fix 0 vs 1 confusion for column numbers
In two places we use '0' for a column number. However, the upper left
hand corner of the screen is 1, 1. Fix those two confusions. Also, fix
a comment that flipped the coordinates in a comment (I'm used to the
vt100 convention where it's row, column (eg y, x)) and didn't notice
the rest of the code uses x, y.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D46777
2024-09-24 14:18:42 -06:00
Warner Losh
3fb656f8ef loader: Use printc instead of print to fit in 24,80
print automatically adds a newline, while printc does not. Use printc in
preference to print for managing the autoboot message. This means we can
use line 24 safely on a 24x80 terminal, restoring some functionality
that was lost in 101afbc6ee.

Note: we still set the default curosor position to 25,1 in screen.lua,
but real VT100s (and successors) will treat any row larger than the
pnumber of rows in a cursor motion command to be the last physical row
(this is so you can move to 9999,9999 and do a cursor location query to
get the size of the screen). Keeping that as is looks better on a
typical VGA console.

Fixes: 101afbc6ee
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision:	https://reviews.freebsd.org/D46771
2024-09-24 10:57:11 -06:00
Dimitry Andric
f97c7fdc59 Bump lld LINKER_FREEBSD_VERSION for reproducibility fix
The upstream fix to make lld output for our EFI loaders reproducible
again was committed in 54521a2ff9. Bump lld's LINKER_FREEBSD_VERSION
to be able to check this in the EFI loader Makefile.

MFC after:	3 days
2024-09-22 19:12:38 +02:00
Warner Losh
17cccb6f90 libsa: Fix a comment to be less vague
Be more specific about where this is used.

Sponsored by:		Netflix
2024-09-22 07:32:00 -06:00
Colin Percival
74a28cf6e7 loader: Load platform entropy even without menu
In 5c73b3e0a3 calls to core.loadEntropy were added to core.boot
and core.autoboot; but neither of those is invoked if we disable
the "beastie" menu.  Add a core.loadEntropy call to the no-menu
path.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Amazon
Fixes:	5c73b3e0a3 ("Add support for getting early entropy from UEFI")
Differential Revision:	https://reviews.freebsd.org/D46637
2024-09-22 00:35:48 -07:00
Colin Percival
c8ebbd28aa loader: Expand EFI entropy if < 2048 bytes
The EFI RNG on some platforms takes a long time if we request 2048
bytes of entropy, so we would like to request less; but our kernel
Fortuna RNG needs to be fed 2048 bytes in order to consider itself
"fully seeded".  If we have between 64 bytes (the size of a single
Fortuna pool and enough to guarantee cryptographic security) and
2048 bytes (what Fortuna wants) then the boot process will hang
waiting for more entropy despite in fact having enough to operate
securely.

Since 64 bytes of entropy is plenty to be cryptographically secure
(an attack of cost ~ 2^128 is infeasible, which implies a mere 16
bytes of entropy), use PBKDF2 (aka pkcs5v2_genkey_raw) to spread
the entropy across 2048 bytes.  This is secure since PBKDF2 has
the property that every subset of output bytes has within O(1) of
the maximum possible amount of entropy.

Reviewed by:	pjd
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46635
2024-09-22 00:35:48 -07:00
Colin Percival
925f15731e loader: Make pkcs5v2 unconditionally available
This was previously only available if GELI support was included, but I
want to use it for processing entropy from EFI

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46634
2024-09-22 00:35:47 -07:00
Colin Percival
f4a69a933c loader: Make EFI entropy size configurable
Add a new loader variable entropy_efi_seed_size which defaults to 2048;
if not defined (e.g. if the /boot/lua/ is updated but /boot/defaults/
isn't) the same 2048 default will be used.

Reviewed by:	Val Packett
MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46632
2024-09-22 00:35:47 -07:00
Colin Percival
b58fe4eb29 loader: Instrument EFI GetRNG with TSLOG
On some systems, the EFI GetRNG is slow.  Make it show up in flamecharts.

MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46631
2024-09-22 00:35:47 -07:00
Colin Percival
58ec2d0d4a loader: Add TSLOG to interpreter built-ins
Wrap each call to a built-in command with TSENTER/TSEXIT to make
it easier to see where time is going in the loader.

MFC after:	1 week
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D46630
2024-09-22 00:35:47 -07:00
Ahmad Khalifa
6fdb07d5b7 loader: provide error message in command_errmsg instead of printing
Also provide an error message when argc is too long instead of printing
"no error message".

Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1381
2024-09-21 05:25:16 -06:00
Ahmad Khalifa
a698c15a41 loader: remove unneeded variable
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1381
2024-09-21 05:25:16 -06:00
Ahmad Khalifa
c105113752 loader: actually change the staging slop
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1381
2024-09-21 05:25:15 -06:00
Graham Perrin
45001ab45e loader.efi.8: BOOOTX64.EFI: fix typo
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1412
2024-09-21 05:25:15 -06:00
Ahmad Khalifa
b538d49110 Add a new sysctl in order to diffrentiate UEFI architectures
With the new 32-bit UEFI loader, it's convenient to have a sysctl to
figure out how we booted. Can be accessed at machdep.efi_arch

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
2024-09-20 08:45:09 -06:00
Ahmad Khalifa
f8ca5d45c3 stand: Add support for 64-bit machines with 32-bit UEFI implementations
Some machines have 64-bit capable cpus but are stuck on 32-bit uefi
firmware.

Add support for them by building a new "loader_ia32" with
LOADER_DEFAULT_INTERP along with the 64-bit one. The loader
can be disabled using MK_LOADER_IA32.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
2024-09-20 08:45:08 -06:00
Ahmad Khalifa
6818ff7797 loader: Fix 32-bit compatibility
main.c - Fix rsdp cast.
framebuffer.c -
 	- Use temp variable instead of directly passing pointer when
          EFI_PHYSICAL_ADDRESS is expected.
	  Also fix FreePages cast.
	- Mask framebuffer address given to us by UEFI.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
2024-09-20 08:45:07 -06:00
Ahmad Khalifa
95f75b0e6e loader: Fix shadow_fb allocation
Using AllocateMaxAddress here means that gfx_state->tg_shadow_fb is
treated as the highest address we can receive. Since
gfx_state->tg_shadow_fb is NULL, we never receive anything. Use
AllocateAnyPages instead.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
2024-09-20 08:45:06 -06:00
Ahmad Khalifa
f0d5b1bdf0 stand/efi: Add a 32-bit variant of libefi
In preparation for supporting 64-bit machines with 32-bit UEFI firmware,
add a 32-bit variant of libefi since we need to compile both the 64-bit
version and the 32-bit version at the same time.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098
2024-09-20 08:45:05 -06:00