Hi,
On 11. 11. 22 16:19, Nico Huber wrote:
Thoughts are tumbling in my head right now: The whole Multiboot spec thing seems too complex to put into ramstage. But so does the Universal Payload thing! If we'd end up with a shim after ramstage anyway, we could as well use the existing standard.
Well it is not so complex. It has two sets of tags, one set is defined by the program to be loaded (defined in its image), and second which defines stuff similar to what coreboot tables are doing (defined in the memory and passed by certain registers at point of handover).
Multiboot2 has a *big* advantage that it also defines the machine state at the point of handover! Note that multiboot2 tags are forced to begin 8 byte aligned which seems like a plus for ABI.
I think there are some limitations of multiboot2 that some fields are only 32-bits. See the EFI notes in there for further hints. From OS point of view, multiboot2 has currently all tables what an OS needs... The previous multiboot1 lacks ACPI pointer which is a nightmare for an OS to find RSDP... (if it is no longer in legacy places...)
Anyway, what you could probably do, is simply to add a way to directly boot multiboot2 payloads from coreboot. You can leave coreboot tables as is for now and create multiboot2 tables out of coreboot tables. That would be a great step forward I think and you would instantly have a way to boot anything multiboot2 capable!
On the other hand If you want to experiment with extending the multiboot2 here are exercises to a kind reader:
Check the multiboot2 spec and coreboot_tables.h and see what tags are coreboot unique and which needs to be "added".
1) Think how to incorporate them or piggyback to the multiboot2
a) ask multiboot2 spec owners to create a special "bootloader specific tag"
+--------------------+ u32 | type = 42 | u32 | size | u8[n] | bootloader specific| +--------------------+
You could embedded them in u8[n] either one by one or having it many loader specific tags.
b) for PoC you could probably misuse the bootloader name tag and do following:
3.6.9 Boot loader name
+-------------------+ u32 | type = 2 | u32 | size | u8[8] | COREBOOT | u32 | mustbezero | u32 | reserved | u32 | lb_size | u32 | lb_tag | .... +-------------------+
size = ROUNDUP(8 + 8 + 4 + 4 + lb_size, 8)
And you could have multiple boot loader tags, each for extended coreboot tag...
And there you have it...
Thanks, Rudolf