All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Qemu] [PATCH] Allow booting large Coreboot image as BIOS
@ 2010-05-19  6:45 Ed Swierk
  0 siblings, 0 replies; only message in thread
From: Ed Swierk @ 2010-05-19  6:45 UTC (permalink / raw)
  To: Coreboot, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

When I build a 1024-kB Coreboot image (emulation/qemu-x86 mainboard),
qemu goes into a loop, resetting just after the "Jumping to boot code"
message.  This can be avoided by removing the "| IO_MEM_ROM" from the
call to cpu_register_physical_memory(0x100000 - isa_bios_size, ...)
call in pc_memory_init().

The next problem I hit is the complaint "ERROR: No valid CBFS header
found!  Maybe the ROM isn't entirely mapped yet?".  I can work around
this by allocating a separate chunk of RAM for the top 128 kB of the
BIOS image in ISA space and copying it rather than mapping it from the
full ROM image.

Both of these changes are the result of random hacking rather than any
real understanding of the issues involved.  I'd appreciate any better
ideas.

Signed-off-by: Ed Swierk <eswierk@aristanetworks.com>
---
 hw/pc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

[-- Attachment #2: 0001-Current-qemu-has-problems-booting-with-Coreboot-in-p.patch --]
[-- Type: text/x-patch, Size: 799 bytes --]

diff --git a/hw/pc.c b/hw/pc.c
index 20dc7fd..88478e7 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -880,7 +880,10 @@ void pc_memory_init(ram_addr_t ram_size,
         isa_bios_size = 128 * 1024;
     cpu_register_physical_memory(0x100000 - isa_bios_size,
                                  isa_bios_size,
-                                 (bios_offset + bios_size - isa_bios_size) | IO_MEM_ROM);
+                                 qemu_ram_alloc(isa_bios_size));
+    cpu_physical_memory_write_rom(0x100000 - isa_bios_size,
+                                  qemu_get_ram_ptr(bios_offset + bios_size - isa_bios_size),
+                                  isa_bios_size);
 
     option_rom_offset = qemu_ram_alloc(PC_ROM_SIZE);
     cpu_register_physical_memory(PC_ROM_MIN_VGA, PC_ROM_SIZE, option_rom_offset);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-19  6:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-19  6:45 [Qemu-devel] [Qemu] [PATCH] Allow booting large Coreboot image as BIOS Ed Swierk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.