Skip to contentSkip to conversation

multiboot: Fix upper memory size in multiboot info

PATCH Applied Kevin Wolf 2 participants 2 messages Jan 4, 2011 – Jan 23, 2011

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 multiboot: Fix upper memory size in multiboot info

The upper memory size field should exclude the first MB of RAM.

---
 hw/multiboot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/multiboot.c +1 -1
index 7cc3055..0d2bfb4 100644
@@ -306,7 +306,7 @@ int load_multiboot(void *fw_cfg,
                                 | MULTIBOOT_FLAGS_MODULES
                                 | MULTIBOOT_FLAGS_MMAP);
     stl_p(bootinfo + MBI_MEM_LOWER,   640);
-    stl_p(bootinfo + MBI_MEM_UPPER,   ram_size / 1024);
+    stl_p(bootinfo + MBI_MEM_UPPER,   (ram_size / 1024) - 1024);
     stl_p(bootinfo + MBI_BOOT_DEVICE, 0x8001ffff); /* XXX: use the -boot switch? */
     stl_p(bootinfo + MBI_MMAP_ADDR,   ADDR_E820_MAP);
 
Signature · 1 line
1.6.0.2
#1 lore raw
Quoted 12 lines · Kevin Wolf

The upper memory size field should exclude the first MB of RAM.

---
 hw/multiboot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/multiboot.c +0 -0
index 7cc3055..0d2bfb4 100644

hw/multiboot.c int load_multiboot(void *fw_cfg, · line 312

Quoted 8 lines
hw/multiboot.c +1 -1
@@ -306,7 +306,7 @@ int load_multiboot(void *fw_cfg,
                                 | MULTIBOOT_FLAGS_MODULES
                                 | MULTIBOOT_FLAGS_MMAP);
     stl_p(bootinfo + MBI_MEM_LOWER,   640);
-    stl_p(bootinfo + MBI_MEM_UPPER,   ram_size / 1024);
+    stl_p(bootinfo + MBI_MEM_UPPER,   (ram_size / 1024) - 1024);
     stl_p(bootinfo + MBI_BOOT_DEVICE, 0x8001ffff); /* XXX: use the -boot switch? */
     stl_p(bootinfo + MBI_MMAP_ADDR,   ADDR_E820_MAP);
 

Thanks, applied.

Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net