[SeaBIOS] Methods to reduce bios image size

Bruce Rogers brogers at suse.com
Tue Mar 24 17:22:13 CET 2015


All,

When building SeaBIOS in the context of QEMU v2.3-rc0 using
various openSUSE versions we found that some recent versions
overflowed the 128K limit imposed for bios.bin. The Makefile
fails with the suggestion of using a more recent toolset or of
eliminating some features to make it fit. Neither of those are
options in this case.

Of course another option is to review the code for places where
variables or strings can be reduced in size without changing
functionality. That doesn't buy us all that much, but enough
for all of our cases except the oldest toolset. I'll post the
patches I came up with during this review of the SeaBIOS code
shortly to see what people think.

The 128K bios.bin needed by older QEMU machine types doesn't
need new functionality, but some future SeaBIOS changes will
undoubtedly still cause it to continue to grow a bit. Since we are
right at the boundary of overflowing 128K, I thought it was worth
investing some effort in backing away from that limit so we don't
have to constantly worry about every small change causing an
issue there.

In addition to the above mentioned data size reductions, another thing
I noticed was that the e820 array is 32 entries, as given by BUILD_MAX_E820.
It appears that QEMU only will ever fill 16 of those entries, so perhaps
it would make sense to reduce that size when the usage is for QEMU only.

As a more general query, I was wondering if anyone else knew of places
where the size of SeaBIOS could be reduced? I'd be happy to try to help
make that happen.

Thanks,

Bruce Rogers




More information about the SeaBIOS mailing list