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
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 */
_______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel