[SeaBIOS] Proper support for PCI-based option rom loading (was Re: [Qemu-devel] Re: qdev property bug?)

Anthony Liguori anthony at codemonkey.ws
Tue Dec 15 22:41:02 CET 2009

Michael S. Tsirkin wrote:
> On Tue, Dec 15, 2009 at 01:35:52PM -0600, Anthony Liguori wrote:
>> Gerd Hoffmann wrote:
>>> -kernel didn't work on a quick test.
>> Thinking about how to fix this, we have two options.
> Hmm, can you pls explain why it stops working?

Sure.  SeaBIOS loads roms in a few ways.

If CONFIG_OPTIONROMS_DEPLOYED, then SeaBIOS scans the 0xc0000..0xf0000 
region for anything that looks like a rom.  This is how Bochs did it and 
is what qemu supports.  This is not how modern systems work though.

Modern systems (SeaBIOS with !CONFIG_OPTIONROMS_DEPLOYED), walk the PCI 
bus and look for any device with a PCI_ROM_ADDRESS that maps a valid 
option rom.  It will map the rom in PCI memory and run it's init 
function.  The rom can use PMM to allocate temporary memory to 
reorganize itself.  During this time, the rom area is writable.  The rom 
will create a stub that's usually pretty small that gets loaded by the 
BIOS after init into the 0xc0000..0xf0000 region.

So when !CONFIG_OPTIONROMS_DEPLOYED, SeaBIOS does look in this region 
for roms because it maps them all from the actual PCI devices.

SeaBIOS can also load roms from up to two fixed physical addresses (when 

BTW, I'm pretty sure this style of option rom loading (from a PCI 
device) is going to be required for device passthrough if we want to 
support running those roms in the guests.  In fact, it should Just Work 

>> Regards,
>> Anthony Liguori
>>> cheers,
>>>   Gerd
> Will be a problem for non-PCI systems?

You mean, non-PCI x86 systems?  I think -m isapc is mainly used for dos 
guests.  I don't think it's really useful in combination with -kernel 
and certainly not for extboot.


Anthony Liguori

More information about the SeaBIOS mailing list