HomeFreeBSD

stand: Raise limit to 550,000 bytes for loader

Description

stand: Raise limit to 550,000 bytes for loader

Raise the limit for /boot/loader to be 550k. The IBM PC imposes a limit
of 640k of RAM below 1MB, which is needed for real mode calls. BTX takes
40k of that. The BIOS takes some amount (25k seems a good "99% take less
than or equal to this" estimate for that, though some systems consume
more). Most typical setups need 25k of stack. This leaves 550k for
code. We set the limit to 550,000 which gives about an extra 13,000
bytes of buffer for machines that whose setups use a little more stack
or whose BIOS reserves a bit more...

Add this derivation in the Makefile. Also recommend setting LOADERSIZE
lower in /etc/src.conf when the loader has to run on a system whose BIOS
takes up more space, or for a complex setup. Add a recipe for how to
find how much RAM your BIOS uses as well (thanks to jhb@ for the
trick). Network cards that boot via PXE and HBAs with their BIOS enabled
are known to be large consumers of lomem space.

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D36152

(cherry picked from commit f8a199f28f9de46fe7360c3a4a0e19e71be72721)

stand: Fix a couple of comment typos in f8a199f28f9d

The commit message documented it as /etc/src.conf but the comment in the
source mentioned the non-existent /etc/loader.conf.

Fixes: f8a199f28f9d ("stand: Raise limit to 550,000 bytes for loader")
(cherry picked from commit 3179bb2737493bc4191c3239226bda50f0b64b8f)

Details

Provenance
impAuthored on Aug 12 2022, 4:59 AM
Reviewer
jhb
Differential Revision
D36152: stand: Derive the limits for /boot/loader
Parents
rGdba7abcda4a8: stand: Go back to a.out format for /boot/loader
Branches
Unknown
Tags
Unknown