Pre-initialize the e820 buffer to all zero, except for the active bit;
we have found that BIOSes will make assumptions about the pre-existing
value of the buffer and this seems the most conservative value.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
ireg.ecx.l = sizeof(*e820buf);
ireg.es = SEG(e820buf);
ireg.edi.w[0] = OFFS(e820buf);
+ memset(e820buf, 0, sizeof *e820buf);
+ e820buf->extattr = 1;
do {
__intcall(0x15, &ireg, &oreg);
mov dword [E820Max],-(1 << 20) ; Max amount of high memory
mov dword [E820Mem],(1 << 20) ; End of detected high memory
.start_over:
+ mov di,E820Buf
+ xor ax,ax
+ mov cx,12
+ rep stosw ; Clear buffer
+ mov byte [di-4],01h ; Initial extattr value
xor ebx,ebx ; Start with first record
jmp short .do_e820 ; Skip "at end" check first time!
.int_loop: and ebx,ebx ; If we're back at beginning...
com32sys_t regs;
memset(®s, 0, sizeof regs);
+ memset(buf, 0, sizeof *buf);
+ buf->extattr = 1;
do {
regs.eax.l = 0x0000e820;