[coreboot] Questions about CBFS

Patrick Georgi patrick at georgi-clan.de
Mon Aug 17 17:11:54 CEST 2009

Am 12.08.2009 23:45, schrieb Thomas Jourdan:
> I can send a patch for review but it's not really clean code :
> - I need some memory to store the page translation tables before going
> to 64 bits. It's hardcoded to some unused (I hope) location. How can I
> allocate space in a generic way ? Is it possible to reuse the resource
> allocator for this ?
When the payload is running, all memory marked "free" in the memory map 
(see cbtable) is up for the payload to use. coreboot doesn't exist 
anymore at that point.
> - If the payload returns, I guess I shall switch back to protected mode.
> Under which circumstances a payload can return ?
We don't really support payloads that return. There was some work in 
that direction with bayou, but as far as I can tell, it isn't really 
specified yet.
As for, when a payload can return, that's up to your payload. If you 
don't need it to return, it won't :-)
> - When a payload is parsed and added in the CBFS rom, is there any way
> to know if this is 32 or 64 code ? I added a field elfclass in the
> cbfs_payload structure to keep the information.
Sounds good to me, that's what the subheaders are for.
> Other question : what is the correct way to insert code running from ram
> (a stage) in the bootblock or at a fixed location ? In my case, after
The bootblock should be left alone after it's generated. CBFS has 
nothing to do with it.
> But I need to be sure that this custom stage lives in the top block (64
> KB) of my FWH (2MB). Is there any way to specify this ?
Right now, the top 64kb are usually managed by the bootblock. The code 
that coreboot jumps to after CAR is also there, the stages in CBFS are 
the compressed RAM stages.
So you'll have to shove your recovery stage into the bootblock 
"somehow". The easiest solution in the old buildsystem is probably to 
add another stage (besides failover/fallback/normal), and special case 
its build somehow (so the ram stage isn't built or linked).
The new build system only supports building one variant for now, until 
we figured out how to properly do it with the capabilities CBFS gives us.


More information about the coreboot mailing list