]> xenbits.xensource.com Git - seabios.git/commitdiff
build: explicitly set ROM size
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 24 Sep 2013 08:06:16 +0000 (10:06 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 30 Sep 2013 10:26:08 +0000 (12:26 +0200)
Add a config option to specify the rom size wanted.  Default is zero,
which will automatically figure the needed size.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Makefile
scripts/checkrom.py
src/Kconfig

index d763ae314c88cd9e7c6376d8fb41732fc05cd850..283938ae971f93968b3221def725193ae7fbacff 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -178,7 +178,8 @@ $(OUT)bios.bin.elf $(OUT)bios.bin: $(OUT)rom.o scripts/checkrom.py
        @echo "  Prepping $@"
        $(Q)$(OBJDUMP) -thr $< > $<.objdump
        $(Q)$(OBJCOPY) -O binary $< $(OUT)bios.bin.raw
-       $(Q)$(PYTHON) ./scripts/checkrom.py $<.objdump $(OUT)bios.bin.raw $(OUT)bios.bin
+       $(Q)$(PYTHON) ./scripts/checkrom.py $<.objdump $(CONFIG_ROM_SIZE) \
+               $(OUT)bios.bin.raw $(OUT)bios.bin
        $(Q)$(STRIP) -R .comment $< -o $(OUT)bios.bin.elf
 
 
index 6f07ac8890abd13ddf535bf65da421ea3cbdc975..aa3dd0d1affe787c9bef3d19edd66a2b6896b68b 100755 (executable)
@@ -21,7 +21,7 @@ def checksum(data, start, size, csum):
 
 def main():
     # Get args
-    objinfo, rawfile, outfile = sys.argv[1:]
+    objinfo, finalsize, rawfile, outfile = sys.argv[1:]
 
     # Read in symbols
     objinfofile = open(objinfo, 'rb')
@@ -32,11 +32,20 @@ def main():
     rawdata = f.read()
     f.close()
     datasize = len(rawdata)
-    finalsize = 64*1024
-    if datasize > 64*1024:
-        finalsize = 128*1024
-        if datasize > 128*1024:
-            finalsize = 256*1024
+    finalsize = int(finalsize) * 1024
+    if finalsize == 0:
+        finalsize = 64*1024
+        if datasize > 64*1024:
+            finalsize = 128*1024
+            if datasize > 128*1024:
+                finalsize = 256*1024
+    if datasize > finalsize:
+        print "Error!  ROM doesn't fit (%d > %d)" % (datasize, finalsize)
+        print "   You have to either increate the size (CONFIG_ROM_SIZE)"
+        print "   or turn off some features (such as hardware support not"
+        print "   needed) to make it fit.  Trying a more recent gcc version"
+        print "   might work too."
+        sys.exit(1)
 
     # Sanity checks
     start = symbols['code32flat_start'].offset
index c40cc610edbc81481a6e57fb6dcc182eb122a31f..20d2a3ed680aad6eadc2fd3ee3ccfb9ffd6b9774 100644 (file)
@@ -122,6 +122,17 @@ endchoice
             selected, the memory is instead allocated from the
             "9-segment" (0x90000-0xa0000).
 
+    config ROM_SIZE
+        int "ROM size (in KB)"
+        default 0
+        help
+            Set the ROM size.  Say '0' here to make seabios figure the
+            needed size automatically.
+
+            Currently SeaBIOS will easily fit into 256 KB. To make it fit
+            it into 128 KB (which was big enouth for a long time) you'll
+            probably have to disable some featues such as xhci support.
+
 endmenu
 
 menu "Hardware support"