Hello -
First time poster, so take it easy on me :)
This is a great project -- I was able to get a kvm+coreboot+SeaBIOS environment going pretty easily. I started with the master branch of coreboot and went from there.
I am having a problem trying to load a Linux kernel+initramfs cbfs payload from SeaBIOS. I can successfully boot the same kernel+initramfs straight from coreboot (without SeaBIOS) as a payload.
I started this topic on the SeaBIOS list -- there's a lot of good background in the replies there:
http://www.seabios.org/pipermail/seabios/2014-August/008215.html
I now think my problem lies in the cbfstool and the Linux trampoline.
Summarizing the analysis from those posts: the Linux trampoline code does not set up the segment descriptors for __BOOT_CS and __BOOT_DS as described in the Linux kernel documentation:
... a GDT must be loaded with the descriptors for selectors __BOOT_CS(0x10) and __BOOT_DS(0x18); both descriptors must be 4G flat segment; __BOOT_CS must have execute/read permission, and __BOOT_DS must have read/write permission;
Now in the working coreboot case it turns out the segment descriptors at selectors 0x10 and 0x18, setup in the coreboot ramstage, match what the Linux kernel expects (see coreboot/src/arch/x86/lib/c_start.S).
In the non-working SeaBIOS case the segment descriptors are configured differently and the cbfs Linux payload does not work.
If the cbfs Linux payload is to be used in multiple environments should the trampoline take care of descriptors that Linux requires?
Attached is a patch to util/cbfstool/linux_trampoline.c that does just that. Basically I borrowed the descriptor configs from coreboot/src/arch/x86/lib/c_start.S for selectors 0x10 and 0x18.
Apologies for my poor x86 assembly coding -- first time.
Cheers, Curt
Curt, this is super great news for me to hear, and if you can show me how to do the linux boot with linux as payload I need to see it. I screwed it up and it did not work for me :)
one thing I wonder: if you can boot linux as the payload, what's the reason to use seabios? I'm missing something.
Many thanks
ron