This patch series updates the SeaBIOS' low-memory allocation scheme so that it no longer uses the EBDA or the 9-segment for internal low memory allocations. Instead, the e-segment is used where SeaBIOS requires read/writable "low" memory.
There is now plenty of space in the e-segment (there has been ever since SeaBIOS was updated to relocate its initialization code), while using 9-segment space can reserve the memory from OS use (in particular on older operating systems). Also, using the 9-segment (and indirectly the EBDA) is more fragile as it requires handling of a relocatable EBDA.
As a result of this change, SeaBIOS will be able to allocate larger amounts of low-memory. Indeed, the size of the "extra stack" for 16bit code is increased from 512 bytes to 2K in this series.
Changes in v2: * Fixed ehci error resulting from changes to stack alignment * Introduce new GET/SET_LOW and GET/SET_LOWFLAT macros (which mirror GET_GLOBAL and GET_GLOBALFLAT) which produce better 16bit code.
-Kevin
Kevin O'Connor (9): Use the e-segment instead of the 9-segment for bios "low mem". Add mechanism to declare variables as "low mem" and use for extra stack. Convert timer code EBDA variables to VARLOW variables. Convert boot code EBDA variables to VARLOW variables. Convert ps2 code EBDA variables to VARLOW variables. Convert USB keyboard code EBDA variables to VARLOW variables. Convert disk code EBDA variables to VARLOW variables. EBDA cleanups. Convert GET/SET_FLATPTR() accesses to "low mem" to GET/SET_LOWFLAT().
src/acpi.c | 2 +- src/ahci.c | 2 +- src/asm-offsets.c | 8 -- src/ata.c | 7 +- src/biosvar.h | 100 ++++------------ src/block.c | 5 +- src/blockcmd.h | 2 + src/boot.c | 19 ++-- src/bootsplash.c | 1 - src/cdrom.c | 84 +++++++------- src/clock.c | 32 +++--- src/config.h | 2 + src/coreboot.c | 3 +- src/disk.c | 75 +++++------- src/disk.h | 38 ++++++- src/memmap.c | 2 +- src/mouse.c | 31 +++--- src/mtrr.c | 2 +- src/optionroms.c | 14 +-- src/pcibios.c | 2 +- src/pciinit.c | 3 +- src/pirtable.c | 2 +- src/pmm.c | 116 ++++------------- src/post.c | 50 ++++++-- src/ps2port.c | 19 ++-- src/romlayout.S | 8 +- src/shadow.c | 4 +- src/smbios.c | 1 - src/stacks.c | 15 ++- src/types.h | 4 + src/usb-ehci.c | 40 +++--- src/usb-hid.c | 17 ++- src/usb-ohci.c | 26 ++-- src/usb-uhci.c | 43 +++---- src/util.h | 3 +- src/xen.h | 3 +- tools/layoutrom.py | 349 +++++++++++++++++++++++++++++----------------------- 37 files changed, 551 insertions(+), 583 deletions(-)