[SeaBIOS] [PATCH] Allow rom to grow to 256K.

Kevin O'Connor kevin at koconnor.net
Sat Sep 25 18:55:51 CEST 2010


Enable rom size to be over 128K.

Apparently, only the first 128K of the rom are mirrored to the
0xc0000-0xfffff area under qemu, so make sure to copy the rom (via
make_bios_writable) in the non-init part of the startup code.  This
ensure the copy code is itself available.
---
 src/post.c        |   13 ++++++-------
 tools/checkrom.py |    2 ++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/post.c b/src/post.c
index 4a75f51..a72b8cd 100644
--- a/src/post.c
+++ b/src/post.c
@@ -321,18 +321,11 @@ reloc_init(void)
     func();
 }
 
-static int HaveRunPost;
-
 // Start of Power On Self Test (POST) - the BIOS initilization phase.
 // This function sets up for and attempts relocation of the init code.
 void VISIBLE32INIT
 post(void)
 {
-    // Allow writes to modify bios area (0xf0000)
-    make_bios_writable();
-
-    HaveRunPost = 1;
-
     // Detect ram and setup internal malloc.
     memmap_setup();
     qemu_cfg_port_probe();
@@ -347,6 +340,8 @@ post(void)
  * POST entry point
  ****************************************************************/
 
+static int HaveRunPost;
+
 // Attempt to invoke a hard-reboot.
 static void
 tryReboot(void)
@@ -385,6 +380,10 @@ _start(void)
         // This is a soft reboot - invoke a hard reboot.
         tryReboot();
 
+    // Allow writes to modify bios area (0xf0000)
+    make_bios_writable();
+    HaveRunPost = 1;
+
     // Perform main setup code.
     post();
 }
diff --git a/tools/checkrom.py b/tools/checkrom.py
index 42cf2df..6309528 100755
--- a/tools/checkrom.py
+++ b/tools/checkrom.py
@@ -24,6 +24,8 @@ def main():
     finalsize = 64*1024
     if datasize > 64*1024:
         finalsize = 128*1024
+        if datasize > 128*1024:
+            finalsize = 256*1024
 
     # Sanity checks
     start = symbols['code32flat_start'].offset
-- 
1.7.2.3




More information about the SeaBIOS mailing list