bootloader/bios_ia32: Automatically zero bios_regs on initialization.
Many places didn't zero them, so we'd put bogus data in those registers
during BIOS calls.
Diff
src/system/boot/platform/bios_ia32/bios.h | 4 ++++
src/system/boot/platform/bios_ia32/mmu.cpp | 5 +++++
2 files changed, 8 insertions(+), 1 deletion(-)
@@ -21,6 +21,10 @@
uint32 edi;
uint16 es;
uint16 flags;
#ifdef __cplusplus
bios_regs() : eax(0), ebx(0), ecx(0), edx(0), esi(0), edi(0), es(0), flags(0) {}
#endif
};
#define CARRY_FLAG 0x01
@@ -296,10 +296,13 @@
get_memory_map(extended_memory **_extendedMemory)
{
extended_memory *block = (extended_memory *)kExtraSegmentScratch;
bios_regs regs = {0, 0, sizeof(extended_memory), 0, 0, (uint32)block, 0, 0};
bios_regs regs;
uint32 count = 0;
TRACE("get_memory_map()\n");
regs.ecx = sizeof(extended_memory);
regs.edi = (uint32)block;
do {
regs.eax = 0xe820;