Allow rom to grow to 256K.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 25 Sep 2010 16:48:43 +0000 (12:48 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 25 Sep 2010 16:48:43 +0000 (12:48 -0400)
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
tools/checkrom.py

index 4a75f511141429ddaaf9290ce917cbf9912e21f0..a72b8cdcba122030afe7478afba1f806d1994085 100644 (file)
@@ -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();
 }
index 42cf2df67f025eb08d4bce5a462e175ad85bff20..6309528e308bb46b99a5f1576af74127f26ca9f1 100755 (executable)
@@ -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