[syslinux] Re: mboot.c32, weird e820 map on HP blade machine, possible memory corruption
H. Peter Anvin
hpa at zytor.com
Wed Mar 15 13:23:20 PST 2006
Tim Deegan wrote:
> Hi Ram,
> Just saw your latest message about optimization levels. Does explicitly
> clearing the registers help? Shouldn't make a difference, since es:edi
> is the only address we pass, but...
> --- old/mboot.c 2006-03-15 10:12:43.000000000 +0000
> +++ ./mboot.c 2006-03-15 10:13:21.000000000 +0000
> @@ -359,6 +359,7 @@
> while(((void *)(e820 + 1)) < __com32.cs_bounce +
> memset(e820, 0, sizeof (*e820));
> + memset(®s_in, 0, sizeof regs_in);
> e820->size = sizeof(*e820) - sizeof(e820->size);
> /* Ask the BIOS to fill in this descriptor */
Explicitly clearing registers is usually a good idea, I've found. It
cuts down on weirdness.
One thing I think in particular might be important is to set eflags,
which mboot.c currently doesn't do. eflags set to a random value is
usually bad news.
More information about the Syslinux