multiboot: Fix upper memory size in multiboot info
authorKevin Wolf <mail@kevin-wolf.de>
Tue, 4 Jan 2011 13:03:30 +0000 (14:03 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 23 Jan 2011 21:44:13 +0000 (22:44 +0100)
The upper memory size field should exclude the first MB of RAM.

Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
hw/multiboot.c

index 7cc30553598c81f74b0a63cc19096e2239da9216..0d2bfb4973b4b5fcd05324188c42a16958b02703 100644 (file)
@@ -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);