freebsd-dev/stand/i386
Warner Losh 39fdad34e2 stand: impose 510,000 byte limit for /boot/loader and /boot/pxeldr
The BIOS method of booting imposes an absolute limit of 640k for the
size of the program being run due to btx. In practice, this means that
programs larger than about 500kiB will fail in odd ways as the stack /
heap will overflow.

Pick 510,000 as the cutoff line semi-arbitrarily. loader_lua is now
almost too big and we want to break the build when it crosses this
threshold. In my experience, below 500,000 always works, above 520,000
always seems to fail with things getting bad somewhere between 512,000
to 515,000. 510,000 is as close to the line as I think we can go, though
experience may dictate we need to lower this in the future.

This is at-best a stop-breakage until we have a better way to subset the
boot loader for BIOS booting to allow better, more fined-tuned
/boot/loaders for the many different environments they have to run
in. This likely means we'll have a graphical loader than understands a
few filesystmes for installation, and a non-graphical loader that
understands the most filesystems possible for everything else in the
future. Our build infrastructure needs some work before we can do that,
however.

At this late date, it likely isn't worth the efforts to move parts of
the loader into high memory. There's a number of assumptions about where
the stack is, where buffers reside, etc that are fulfilled when it lives
in the first 640k that would need bounce buffers and/or other counter
measures if we were to split it up. All BIOS calls are done in 16-bit
mode with SEG:OFF addresses, requiring them to be in the first 640k of
RAM. And nearly all machines in the last decade can boot with UEFI
(though there's some exceptions, so it isn't worth killing outright
yet).

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D36129
2022-08-10 21:29:20 -06:00
..
boot0 Revert r362466 2020-06-22 07:46:24 +00:00
boot0sio
boot2 Adjust parse() definition in boot2 to avoid clang 15 warning 2022-07-15 21:18:28 +02:00
btx
cdboot
common loader: edd_device_path_v3 is too small 2020-10-12 09:34:50 +00:00
gptboot gptboot.8: Fix a typo and fix lint warnings 2022-03-18 11:35:04 +01:00
gptzfsboot loader: implement mount/unmount rootfs 2021-09-08 04:01:20 +03:00
isoboot Don't add -Winline for WARNS=6 2021-03-22 11:55:45 +00:00
libfirewire stand: Use c99 structure initialization for fwohci device 2022-07-24 16:53:34 -06:00
libi386 stand: Make sure nobody has a NULL pointer for dv_cleanup 2022-07-27 09:04:13 -06:00
loader stand: impose 510,000 byte limit for /boot/loader and /boot/pxeldr 2022-08-10 21:29:20 -06:00
loader_4th
loader_lua
loader_simp
mbr
pmbr Fix pmbr issues > 2TB 2021-07-13 15:40:44 -06:00
pxeldr stand: impose 510,000 byte limit for /boot/loader and /boot/pxeldr 2022-08-10 21:29:20 -06:00
zfsboot loader: implement mount/unmount rootfs 2021-09-08 04:01:20 +03:00
boot.ldscript Link stand/i386 components using a linker script 2020-03-04 21:01:22 +00:00
Makefile stand: properly declare subdir deps or .WAIT, do parallel build 2020-12-31 11:15:45 -06:00
Makefile.inc Remove quotes around Makefile .error/.warn/.info strings 2022-01-22 14:03:07 -05:00