LinuxBIOS support: map BIOS into ISA address space as RAM instead of ROM
PATCH 1/1 LinuxBIOS support: map BIOS into ISA address space as RAM instead of ROM
LinuxBIOS writes the IRQ routing table (PIRQ) to 0xf000 and then reads it back to verify the write. Currently qemu maps the top 128 KB of the BIOS into ISA address space (0xe000 - 0xffff) as ROM, which causes the write to fail, preventing Linux from finding interrupt routing info.
This patch changes qemu to map the BIOS into ISA address space as RAM instead of ROM, allowing LinuxBIOS to run on qemu with no further modifications (although the DRAM size is still not detected properly).
I've verified that Windows 2000 and Linux still boot with the Bochs BIOS with this patch applied.
--Ed
hw/pc.c +1 -1
@@ -530,7 +530,7 @@ static void pc_init1(int ram_size, int v IO_MEM_UNASSIGNED);cpu_register_physical_memory (0x100000 - isa_bios_size, isa_bios_size, - (bios_offset + bios_size - isa_bios_size) |IO_MEM_ROM ); + bios_offset + bios_size - isa_bios_size); {ram_addr_t option_rom_offset;
Quoted 3 lines · Ed Swierk
This patch changes qemu to map the BIOS into ISA address space as RAM instead of ROM, allowing LinuxBIOS to run on qemu with no further modifications (although the DRAM size is still not detected properly).
Unfortunately this isn't the right answer, as modifying the BIOS area messes things up on soft reboot. What we really want is shadow RAM support, which Bochs seems to support but qemu doesn't.
--Ed
Quoted 10 lines · Ed Swierk
Quoted 3 lines · Ed Swierk
This patch changes qemu to map the BIOS into ISA address space as RAM instead of ROM, allowing LinuxBIOS to run on qemu with no further modifications (although the DRAM size is still not detected properly).
Unfortunately this isn't the right answer, as modifying the BIOS area messes things up on soft reboot. What we really want is shadow RAM support, which Bochs seems to support but qemu doesn't.
Shadow RAM is supported in QEMU and I modified the Bochs BIOS to use it. So you do not need to do any patch in QEMU for it. Please read the rombios32.c source in the Bochs BIOS to know what to do in LinuxBIOS.
To be precise, one case of RAM shadowing is not implemented (read from BIOS, write to RAM), but it is not strictly needed to write data in the shadow RAM. I needed it once to run a real Award BIOS in QEMU, but I did not have the time to clean up the patch to commit it.
Regards,
Fabrice.