[LinuxBIOS] v3: convert stage2 to multi-segment LAR

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Tue Nov 27 17:43:02 CET 2007

On 27.11.2007 17:04, Jordan Crouse wrote:
> On 27/11/07 10:33 +0100, Stefan Reinauer wrote:
>> * Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> [071127 03:55]:
>>> Convert stage2 handling from binary blob to multi-segment LAR which is
>>> created by parsing the ELF file linuxbios.stage2.o. That way, we avoid
>>> manual specification of the entry point for stage2 code. A few LAR
>>> functions are now unused and can be removed in a following cleanup session.
>>> Another suggested cleanup would be factoring out a load_all_segments
>>> function, resulting in less code duplication.
>> I can't believe this is the workaround for not being able to put a 
>> "jmp _entry" in front of the code.
>> It might be becoming just another "how do we explain _that_ to people
>> now?" just like the v2 device tree.
> I'm not saying that the new method isn't a good one, but Stefan has a point.
> This will be difficult to explain to people.  I'll start with the most 
> obvious question:
> How many bytes is it costing me to have N elf files in the LAR instead of
> N blobs?

Bytes in RAM: We save ~3000 bytes in qemu (subject to verification).
Bytes in LAR: We lose 64 bytes per additional ELF section (that includes
7 bytes of filename).

But if we ever really want to save single bytes, attacking the wasted
~4000 bytes in the boot block is definitely the most promising route to go.

Oh, and applying my patch which eliminates dulicated functions from
stage2 will also yield substantial savings.


More information about the coreboot mailing list