* [Qemu-devel] [PATCH] Support for large LinuxBIOS images
@ 2006-09-13 0:49 Ed Swierk
0 siblings, 0 replies; only message in thread
From: Ed Swierk @ 2006-09-13 0:49 UTC (permalink / raw)
To: qemu-devel
[-- 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 */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-09-13 0:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-13 0:49 [Qemu-devel] [PATCH] Support for large LinuxBIOS images Ed Swierk
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).