Hello Ron,
On Thu Aug 28 16:30, ron minnich wrote:
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 :)
If this patch and idea are acceptable I will make a proper git patch and send it along.
For Linux SeaBIOS payload, it was pretty easy, most of the directions are on the coreboot and SeaBIOS wiki. The only problem I had was for the patch I sent.
Here are the steps I used -- I'll take for granted you know how to build coreboot with SeaBIOS as the payload. I did all this work using the emulated i440 qemu machine with a 16Mbyte rom size.
1. once you have your coreboot.rom, use the cbfstool to add images to the rom.
2. For the Linux kernel and initramfs I built a small Linux OS from the Open Network Install Environment (ONIE) project. It is a very simple OS that just runs from a ramdisk.
3. To add a Linux payload to SeaBIOS run the cbfstool like this:
ONIE_IMAGE_DIR="$HOME/onie/build/images" KERNEL="${ONIE_IMAGE_DIR}/kvm_x86_64-r0.vmlinuz" INITRD="${ONIE_IMAGE_DIR}/kvm_x86_64-r0.initrd" CMDLINE="console=tty0 console=ttyS0,115200n8 seabios" $CBFSTOOL $COREBOOT_BUILDDIR/coreboot.rom add-payload -f $KERNEL -n img/LINUX -I $INITRD -C "$CMDLINE"
The only real trick is the image needs to be in the "img" directory in the cbfs for SeaBIOS to find it. See the "-n" argument above.
If you need more info I'm happy to send you the .config for both coreboot and SeaBIOS.
one thing I wonder: if you can boot linux as the payload, what's the reason to use seabios? I'm missing something.
Great question! I am working on the Open Network Install Environment (ONIE) project:
http://www.opencompute.org/wiki/Networking/ONIE http://opencomputeproject.github.io/onie/docs
You can think of ONIE as a "Linux based PXE, with more features". Currently ONIE runs on open, bare metal networking hardware, including PowerPC and x86 machines.
For x86 platforms, I want to have ONIE available in the SeaBIOS boot menu. Having ONIE boot straight from coreboot is interesting (and fast!), but that is not ONIE's sole purpose. The systems and users we are targeting still need a boot menu to select things like "boot from USB", "boot from hard disk", etc.
At the end of the day the point of the networking hardware is to boot the network operating system, not boot ONIE. This is similar to the server world, where the point is to boot the server OS, not PXE.
Cheers, Curt
Curt, what you are doing is similar to what linuxbios was designed for. At Los Alamos in 2001, we were booting thousand node systems with linux as the "payload" (the payload name came later -- at the time, linuxbios always used linux as the payload). Note that linuxbios was renamed to coreboot, it's the same code base. We did this on powerpc, x86, and alpha. The parallels between then and now are interesting.
Our path to boot linux from "whatever" (usb, disk, network) was via bash scripts, which we bundled into the initramfs. My preferred interface for a boot menu is still the shell command line. That way, when things go wrong, you have more there than just a menu. So I'm not yet convinced, once you can put linux and initramfs in flash, that you need seabios, unless the issue is INTxx support for things like grub. But as a Plan 9 GSOC project we put Plan 9 in the boot sector, and that worked fine; I'm not convinced that at any step we need old-fashioned boot loaders at all. The kernels do just fine, in flash, in the boot sector, and over the network. But that's me ;-)
We could boot small (128) node clusters in well under a minute, including the 'linux boots linux' part of the boot; individual nodes took seconds from power on to full functioning; and medium clusters (1500 nodes) would boot in under 150 seconds from power on to all nodes usable, including all the infiniband network config and 'linux boots linux' step. As a contrast, the rom-based iPXE bootstraps were unable to finish configuring ONE interface in the time it took us to boot 1000 nodes.More here: http://lacsi.rice.edu/workspace/downloads/symposium/lacsi_2004/pap124.pdf/
My latest work involves embedding go programs as source in the flash, and compiling them on demand into a ramfs. I'll be talking about this at ELC Europe. Go programs are far more compact than even busybox binaries, and it looks like I can fit the go compilers, all packages, and all the programs into about 8M in flash as part of a linux payload. I've got a ways to go but so far I have not seen any showstoppers. That code is all available on github if you're interested. Once you get a real kernel in your boot path, life can get very interesting.
Have you considered using the payload chooser (bayou) to let you choose linux as the payload or seabios? Then you would not need to have seabios boot linux from flash. Life might be simpler. Bayou can be made to work again -- I did it recently, even for ARM -- and it is kind of handy.
My interest is purely in getting back to the linuxbios scenario -- the only payload being linux.
The ONIE thing is just what I've been looking for for the Go project; I'll be taking a close look.
ron