[SeaBIOS] [PATCH 0/5][RFC] Simultaneous multi-platform support

Kevin O'Connor kevin at koconnor.net
Thu Feb 14 02:02:45 CET 2013


On Wed, Feb 13, 2013 at 09:50:13AM +0000, David Woodhouse wrote:
> - 4940c334 Clean up Kconfig options for CSM
> 
> Merging this would be good.

The "BIOS interfaces" menu allows developers to turn off bios features
for testing or to shrink the SeaBIOS binary size.  I don't see a gain
to limiting what devs can turn off.  Turning off CONFIG_BOOT could be
useful - an embedded device might want support for running legacy
option roms under UEFI but know it will never need to boot in legacy
mode.  CONFIG_OPTIONROMS doesn't do anything under CSM, but maybe it
makes sense to add "if (!CONFIG_OPTIONROMS) return" to the top of
handle_csm_0005.

Granted, CONFIG_OPTIONROMS_DEPLOYED isn't terribly useful - it's
probably about time all that code was just removed.  (Or at least set
to depends on QEMU.)

> - 4def181d Reject non-compliant PCI option ROMs with unaligned PCIR structure
> 
> We can drop this if you're not keen, but it *is* an option so people
> could still keep compatibility with broken ROMs, and consistency is
> good. We'd never have been shipping broken ROMs if we'd done this in the
> first place...

I don't see why one would want to enable an option that will cause the
boot to fail mysteriously for some users.  It wouldn't be a problem if
we thought all roms followed the spec, but we know the current "lgpl
vgabios" violates this.  How about the following instead:

--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -109,6 +109,9 @@ get_pci_rom(struct rom_header *rom)
     struct pci_data *pd = (void*)((u32)rom + rom->pcioffset);
     if (pd->signature != PCI_ROM_SIGNATURE)
         return NULL;
+    if (rom->pcioffset & 3)
+        dprintf(1, "WARNING! Found unaligned PCI rom (vd=%04x:%04x)\n"
+                , pd->vendor, pd->device);
     return pd;
 }
 
-Kevin



More information about the SeaBIOS mailing list