Try to automatically fit sections into open spaces in the fixed area.
Enhance layoutrom.py script to find and locate sections into fixed area.
Have layoutrom.py create output file instead of using redirect from make.
Don't use freespace2 for bios tables in f segment - freespace in fixed
area is now automatically filled.
Change checkrom script to test final_code16_end instead of _start -
this improves catching of alignment errors.
Don't align gdt to 8 bytes - it causes whole section to be aligned,
which causes entry point to be misaligned.
Explicitly reserve space for variables in fixed area so that the space
for them is not auto-filled.
diff --git a/tools/checkrom.py b/tools/checkrom.py
index 6b5f1e9..d03c794 100755
--- a/tools/checkrom.py
+++ b/tools/checkrom.py
@@ -17,24 +17,22 @@
except:
pass
- c16s = syms['code16_start'] + 0xf0000
- c32s = syms['final_code16_start']
- if c16s != c32s:
+ c16e = syms['code16_end'] + 0xf0000
+ f16e = syms['final_code16_end']
+ if c16e != f16e:
print "Error! 16bit code moved during linking (0x%x vs 0x%x)" % (
- c32s, c16s)
+ c16e, f16e)
sys.exit(1)
sizefree = syms['freespace1_end'] - syms['freespace1_start']
size16 = syms['code16_end'] - syms['code16_start'] - sizefree
size32 = syms['code32_end'] - syms['code32_start']
totalc = size16+size32
- tablefree = syms['freespace2_end'] - syms['freespace2_start']
print "16bit size: %d" % size16
print "32bit size: %d" % size32
print "Total size: %d Free space: %d Percent used: %.1f%%" % (
totalc, sizefree
, (totalc / float(size16+size32+sizefree)) * 100.0)
- print "BIOS table space: %d" % tablefree
if __name__ == '__main__':
main()