Browse Source

[multiboot] Build memory map after shutting down and unhiding gPXE

The Multiboot memory map needs to be built after unhiding gPXE and
downloaded images from memory.  Solaris faults during boot when trying
to access the ramdisk, which is hidden from the memory map while gPXE is
executing.  This issue is fixed by using the memory map from after gPXE
unhides itself.

Reported-by: Moinak Ghosh <moinakg@belenix.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
tags/v1.0.0-rc1
Stefan Hajnoczi 15 years ago
parent
commit
2eeb711560
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      src/arch/i386/image/multiboot.c

+ 6
- 2
src/arch/i386/image/multiboot.c View File

@@ -267,8 +267,6 @@ static int multiboot_exec ( struct image *image ) {
267 267
 	memset ( &mbinfo, 0, sizeof ( mbinfo ) );
268 268
 	mbinfo.flags = ( MBI_FLAG_LOADER | MBI_FLAG_MEM | MBI_FLAG_MMAP |
269 269
 			 MBI_FLAG_CMDLINE | MBI_FLAG_MODS );
270
-	multiboot_build_memmap ( image, &mbinfo, mbmemmap,
271
-				 ( sizeof(mbmemmap) / sizeof(mbmemmap[0]) ) );
272 270
 	mb_cmdline_offset = 0;
273 271
 	mbinfo.cmdline = multiboot_add_cmdline ( image->name, image->cmdline );
274 272
 	mbinfo.mods_count = multiboot_build_module_list ( image, mbmodules,
@@ -282,6 +280,12 @@ static int multiboot_exec ( struct image *image ) {
282 280
 	 */
283 281
 	shutdown ( SHUTDOWN_BOOT );
284 282
 
283
+	/* Build memory map after unhiding bootloader memory regions as part of
284
+	 * shutting everything down.
285
+	 */
286
+	multiboot_build_memmap ( image, &mbinfo, mbmemmap,
287
+				 ( sizeof(mbmemmap) / sizeof(mbmemmap[0]) ) );
288
+
285 289
 	/* Jump to OS with flat physical addressing */
286 290
 	DBGC ( image, "MULTIBOOT %p starting execution at %lx\n",
287 291
 	       image, entry );

Loading…
Cancel
Save