Bug#419994: More information about misdetection of e820 memory map
Rafał Kupka
kupson at kupson.fdns.net
Thu Apr 19 14:45:14 UTC 2007
Hello,
I make some more tests to find this bug.
--- grub-0.97/stage2/common.c 2004-03-27 17:25:44.000000000 +0100
+++ new/stage2/common.c 2007-04-19 16:00:00.000000000 +0200
@@ -181,6 +181,7 @@
do
{
cont = get_mmap_entry ((void *) addr, cont);
+ printf("SMAP: addr:%x cont:%x\n", (unsigned long *) addr, cont);
/* If the returned buffer's length is zero, quit. */
if (! *((unsigned long *) addr))
@@ -190,6 +191,7 @@
addr += *((unsigned long *) addr) + 4;
}
while (cont);
+ printf("mbi.mmap_length: %x\n", mbi.mmap_length);
if (mbi.mmap_length)
{
After applying above patch I've got this messages from grub:
SMAP: addr:54964 cont:1
SMAP: addr:5497c cont:2
SMAP: addr:54994 cont:3
SMAP: addr:549ac cont:4
SMAP: addr:549c4 cont:5
SMAP: addr:549dc cont:6
SMAP: addr:549f4 cont:7
SMAP: addr:54a0c cont:8
SMAP: addr:54a24 cont:9
SMAP: addr:54a3c cont:a
SMAP: addr:54a54 cont:0
mbi.mmap_length: 108
displaymem command works as expected, shows whole memory map.
But If I modify source to this version below, I just got:
mbi.mmap_length: 0
and there is no memory map in displaymem output.
--- grub-0.97/stage2/common.c 2004-03-27 17:25:44.000000000 +0100
+++ new/stage2/common.c 2007-04-19 16:00:00.000000000 +0200
@@ -181,6 +181,7 @@
do
{
cont = get_mmap_entry ((void *) addr, cont);
+ /* printf("SMAP: addr:%x cont:%x\n", (unsigned long *) addr, cont); */
/* If the returned buffer's length is zero, quit. */
if (! *((unsigned long *) addr))
@@ -190,6 +191,7 @@
addr += *((unsigned long *) addr) + 4;
}
while (cont);
+ printf("mbi.mmap_length: %x\n", mbi.mmap_length);
if (mbi.mmap_length)
{
I don't understand how mbi.mmap_length may have different value just by
commenting printf out. Something strange happens :(
Maybe this is some BIOS breakage, but Linux kernel always detect memory
correctly.
Motherboards affected:
- MSI K9N SLI Platinum (with BIOS 1.5)
- MSI K9N SLI-2F (BIOS version unknown)
Regards,
Kupson
More information about the Pkg-grub-devel
mailing list