[coreboot] Hackaton in Prague 2011
peter at stuge.se
Tue May 10 02:30:02 CEST 2011
Graeme Russ wrote:
> Well, I do not know the semantic architecture of coreboot :)
Welcome to the list.
> In addition to 'boot OS and die', U-Boot has a 'standalone
> application' API which allows a 'payload' to be run with control
> returning to U-Boot. If coreboot does not have any such concept
> then you are right, no need to worry about returning back to
coreboot does not.
> > memory size is in cbtable, payloads are ELF by convention
> My point being that U-Boot needs to know about the arrangement of
> memory of the target board.
Yes. The information is published by coreboot in the "coreboot table"
AKA cbtable. libpayload already has code to find it.
> The idea of adding support for relocatable ELF images to libpayload is
> interesting. If coreboot can load U-Boot at an appropriate target
> address than we can skip a memcpy and relocation fixup loop in U-Boot.
I think the coreboot loader does this already. If U-Boot is built as
an ELF located at the appropriate target address then that's where
coreboot will run it from.
> >> - Can u-boot piggy-back on SeaBIOS loaded by coreboot?
> > In the context of coreboot: why?
> Again, probably a missunderstanding of coreboot on my behalf -
> U-Boot has a REALLY primative BIOS implementation (just enough to
> trick Linux into booting in an embedded environment). It is
> basically just some empty VGA stubs and simple e820 support. If
> coreboot can load SeaBIOS, U-Boot could transition to it and I
> could ditch all of the real-mode support from U-Boot.
coreboot starts one payload and one payload only. SeaBIOS when built
as payload for coreboot can actually start other files in the boot
flash that are identical to the coreboot payload.
The sequence would then be coreboot->SeaBIOS->U-Boot. Note that
coreboot is not a BIOS and does not want to be a BIOS.
> This could allow U-Boot to support booting of OSs that require a BIOS.
That should work fine if SeaBIOS is inserted before U-Boot and can
set up the complete BIOS environment.
> For Linux, I can implement a protected mode transition from U-Boot
> for which we would not need to load SeaBIOS at all.
This would be something similar to what FILO, GRUB 2 and gPXE do I
guess. Even mkelfImage.
> >> - Can we move more hardware init and drivers from coreboot into
> >> u-boot and provide more commands in u-boot for coreboot
> >> supported boards
> > Code duplication? *shudder*
> The point being that U-Boot provides a shell and command line with
> diagnostic features. These require hooks into the hardware drivers.
coreboot does not generally have drivers. coreboot knows how to do
the init, but the payload is responsible for driving any hardware
that needs to be driven.
One could argue that coreboot is only a collection of CPU and chipset
drivers, which so far have very few if any knobs.
> >> - VGA & Keyboard support
> >> - U-Boot splash screen support
> > libpayload
> >> - Flash updates from u-boot
> > libflashrom (work in progress)
> How will these work in practice? Where are they initiated from?
coreboot starts one payload.
The payload can be very easily created with libpayload, a C library
that we have created in order to make it easy to create payloads. Run
lpgcc instead of gcc to link against libpayload. Some
coreboot-specific functions like accessing the coreboot tables are
available, and a good deal of libc compatibility.
Besides using libpayload, U-Boot would also use libflashrom, to take
advantage of the rich boot flash writing code that is flashrom also
at boot time.
More information about the coreboot