git: boot - Put loader heap in high memory

Matthew Dillon dillon at
Sun Jul 26 01:07:31 PDT 2015

commit 349c99ee28c800cca8338621e90b603e7d452adc
Author: Matthew Dillon <dillon at>
Date:   Sun Jul 26 01:03:46 2015 -0700

    boot - Put loader heap in high memory
    * We ran out of low BIOS memory.  The initrd.img.gz unpacking requires a
      bit more than ~32KB of temporary space and it ran the loader out of
      low-BIOS heap memory.
      This can cause the loader to fail to load the image and prevent proper
      crypto or single-user bootstrapping.
    * Steal the heap from high-memory, just ender the kernel+modules load area
      limit.  For now, steal 1MB, which gives the loader plenty of space again.
      The kernel will lose 1MB of physical memory, boo-hoo.
    * The loader must remove the heap from the SMAP passed to the kernel.
    * Move any objects requiring VTOPSEG/VTOPOFF out of malloc and into a
      static or stack declaration.
    Reported-by: cgag, multiple

Summary of changes:
 lib/libstand/sbrk.c              | 10 +++++-----
 sys/boot/common/module.c         | 11 ++++++++++-
 sys/boot/common/rel_open.c       | 14 ++++++++------
 sys/boot/pc32/libi386/biosdisk.c |  9 +++++----
 sys/boot/pc32/libi386/biosmem.c  |  4 ++++
 sys/boot/pc32/libi386/biossmap.c | 38 +++++++++++++++++++++++++++++++++++---
 sys/boot/pc32/libi386/libi386.h  |  1 +
 sys/boot/pc32/loader/main.c      | 11 +++++++++++
 8 files changed, 79 insertions(+), 19 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list