qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ed Swierk <eswierk@aristanetworks.com>
To: Coreboot <coreboot@coreboot.org>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [Qemu] [PATCH] Allow booting large Coreboot image as BIOS
Date: Tue, 18 May 2010 23:45:05 -0700	[thread overview]
Message-ID: <AANLkTinOeAtW5GB7wEC96AZ0q5vb1ixoOPyxrJSQotlR@mail.gmail.com> (raw)

[-- 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);

                 reply	other threads:[~2010-05-19  6:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinOeAtW5GB7wEC96AZ0q5vb1ixoOPyxrJSQotlR@mail.gmail.com \
    --to=eswierk@aristanetworks.com \
    --cc=coreboot@coreboot.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).