Add config option to permit running option roms with bad checksums.
authorKevin O'Connor <kevin@koconnor.net>
Mon, 7 Mar 2011 00:22:46 +0000 (19:22 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 7 Mar 2011 00:22:46 +0000 (19:22 -0500)
Based on a patch by: Stefan Reinauer <reinauer@google.com>

src/Kconfig
src/optionroms.c

index f064b27a6600163be6003c295d39a81b64b4fc31..6d55b23d7cc1702f00fb490fed905bc7705cb970 100644 (file)
@@ -250,6 +250,17 @@ menu "BIOS interfaces"
             Select this if option ROMs are already copied to
             0xc0000-0xf0000.  This must only be selected when using
             Bochs or QEMU versions older than 0.12.
+    config OPTIONROMS_CHECKSUM
+        depends on OPTIONROMS
+        bool "Require correct checksum on option ROMs"
+        default y
+        help
+            Option ROMs are required to have correct checksums.
+            However, some option ROMs in the wild don't correctly
+            follow the specifications and have bad checksums.
+            Say N here to allow SeaBIOS to execute them anyways.
+
+            If unsure, say Y.
     config PMM
         depends on OPTIONROMS
         bool "PMM interface"
index a94b46c35d2617adda54f717563e500bb189e3c4..37a4e6c512091c77d6fbc64098a9dbd8e3df24d7 100644 (file)
@@ -131,7 +131,8 @@ is_valid_rom(struct rom_header *rom)
     if (sum != 0) {
         dprintf(1, "Found option rom with bad checksum: loc=%p len=%d sum=%x\n"
                 , rom, len, sum);
-        return 0;
+        if (CONFIG_OPTIONROMS_CHECKSUM)
+            return 0;
     }
     return 1;
 }