qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Ed Swierk" <eswierk@arastra.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Support for large LinuxBIOS images
Date: Tue, 12 Sep 2006 17:49:45 -0700	[thread overview]
Message-ID: <c1bf1cf0609121749o4a31770cyc875f3e67bb941c6@mail.gmail.com> (raw)

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

The attached patch makes two changes needed to boot Linux on qemu with
a large (>256KB) LinuxBIOS image instead of the built-in BIOS:

- Increases the space set aside for the BIOS from 256KB to 2MB; this
could of course be increased further, but 2MB seems to be the largest
EEPROM hardware currently available.

- Refrains from mapping the upper 128KB of the BIOS into ISA space
when using a non-default BIOS (size != 64KB). LinuxBIOS writes the PCI
IRQ routing table to 0xf0000, so it has to be left as normal RAM.

With these changes to qemu, plus the following patches to LinuxBIOS,
Linux 2.6.17.11 successfully communicates with qemu's Ethernet and USB
devices:

http://www.openbios.org/pipermail/linuxbios/2006-September/015687.html
http://www.openbios.org/pipermail/linuxbios/2006-September/015688.html

--Ed

[-- Attachment #2: qemu-linuxbios.patch --]
[-- Type: text/x-patch, Size: 2455 bytes --]

diff -BurN qemu-0.8.2.orig/hw/pc.c qemu-0.8.2/hw/pc.c
--- qemu-0.8.2.orig/hw/pc.c	2006-09-12 23:33:03.000000000 +0000
+++ qemu-0.8.2/hw/pc.c	2006-09-12 23:35:47.000000000 +0000
@@ -646,13 +646,13 @@
 
     /* BIOS load */
     bios_offset = ram_size + vga_ram_size;
-    vga_bios_offset = bios_offset + 256 * 1024;
+    vga_bios_offset = bios_offset + 2048 * 1024;
 
     snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
     bios_size = get_image_size(buf);
     if (bios_size <= 0 || 
         (bios_size % 65536) != 0 ||
-        bios_size > (256 * 1024)) {
+        bios_size > (2048 * 1024)) {
         goto bios_error;
     }
     ret = load_image(buf, phys_ram_base + bios_offset);
@@ -677,15 +677,17 @@
     cpu_register_physical_memory(0xc0000, 0x10000, 
                                  vga_bios_offset | IO_MEM_ROM);
 
-    /* map the last 128KB of the BIOS in ISA space */
-    isa_bios_size = bios_size;
-    if (isa_bios_size > (128 * 1024))
-        isa_bios_size = 128 * 1024;
-    cpu_register_physical_memory(0xd0000, (192 * 1024) - isa_bios_size, 
-                                 IO_MEM_UNASSIGNED);
-    cpu_register_physical_memory(0x100000 - isa_bios_size, 
-                                 isa_bios_size, 
-                                 (bios_offset + bios_size - isa_bios_size) | IO_MEM_ROM);
+    if (bios_size == 65536) {
+        /* map the last 128KB of the BIOS in ISA space */
+        isa_bios_size = bios_size;
+        if (isa_bios_size > (128 * 1024))
+            isa_bios_size = 128 * 1024;
+        cpu_register_physical_memory(0xd0000, (192 * 1024) - isa_bios_size, 
+                                     IO_MEM_UNASSIGNED);
+        cpu_register_physical_memory(0x100000 - isa_bios_size, 
+                                     isa_bios_size, 
+                                     (bios_offset + bios_size - isa_bios_size) | IO_MEM_ROM);
+    }
     /* map all the bios at the top of memory */
     cpu_register_physical_memory((uint32_t)(-bios_size), 
                                  bios_size, bios_offset | IO_MEM_ROM);
diff -BurN qemu-0.8.2.orig/vl.h qemu-0.8.2/vl.h
--- qemu-0.8.2.orig/vl.h	2006-09-12 23:33:03.000000000 +0000
+++ qemu-0.8.2/vl.h	2006-09-12 23:34:32.000000000 +0000
@@ -160,7 +160,7 @@
 #elif defined(TARGET_MIPS)
 #define BIOS_SIZE (128 * 1024)
 #else
-#define BIOS_SIZE ((256 + 64) * 1024)
+#define BIOS_SIZE ((2048 + 64) * 1024)
 #endif
 
 /* keyboard/mouse support */

                 reply	other threads:[~2006-09-13  0:49 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=c1bf1cf0609121749o4a31770cyc875f3e67bb941c6@mail.gmail.com \
    --to=eswierk@arastra.com \
    --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).