Guys-
I actually succeeded with the direct kernel method. I think I didn't fully
clean my coreboot build before. I do want to get the floppy method working
too as a learning experience next, but here's what I did so far:

- Build coreboot with the built-in SeaBIOS
- Add my kernel to the cbfs with:

"./build/cbfstool build/coreboot.rom add-payload -f payloads/vmlinuz -n
img/Linux -I payloads/rootfs.gz"

That's actually all it took!

I did not know that SeaBIOS can actually boot kernels without them being
ELF files, but the stuff Peter pointed me to got me on the right track.

Now, to the floppy method!

R


On Fri, Apr 19, 2019 at 6:09 AM Mike Banon <mikeb...@gmail.com> wrote:

> Peter, I believe we shouldn't put it like "ELF versus Floppy" because
> these ways are not mutually exclusive: they could be tried in
> parallel, especially since Rafael's pursuit towards a working solution
> also involves waiting for helpful replies from the mailing lists ;-)
> Also, regarding SeaBIOS: I haven't observed any downsides from SeaBIOS
> providing the BIOS environment. It may be arcane and not modern
> anough, however it does not prevent anything from working: it either
> helps something to work (e.g. some wonderful floppy-based OS which
> relies on the BIOS calls) or simply being inactive if the OS is not
> using this environment.
>
> On Fri, Apr 19, 2019 at 3:12 PM Peter Stuge <pe...@stuge.se> wrote:
> >
> > Rafael Send wrote:
> > > I had already testes the coreboot + Linux kernel without SeaBIOS,
> > > that works fine.
> >
> > That's a great start! So did you look into what happens under the
> > hood when you do that, to learn?
> >
> > The original common case for coreboot payloads was also ELF files, so
> > there is much overlap with what you want to achieve.
> >
> > You probably already noticed the tool mkelfimage in the pages I linked
> to.
> > Did you look into what it does, and why it's needed in the first place?
> > (Hint: Linux is a bit needy.)
> >
> >
> > > But I do want the rest of the boot menu presented by SeaBIOS
> > > because I usually use Windoze as well.
> >
> > SeaBIOS creates a BIOS environment when there isn't one. That is its
> > key feature. This is a coffin for Windows to lie in.
> >
> > BIOS environments are just inadequate in general, and supremely ill
> > equipped in particular for what you want to accomplish.
> >
> > Consider using SeaBIOS exclusively for what it was made; Windows coffin.
> >
> > Consider another payload before (time wise) SeaBIOS to provide the menu.
> >
> >
> > > Even if I put the initrd inside the kernel, that can't be loaded by
> > > SeaBIOS unless the whole thing is an ELF file, right?
> >
> > I guess so.
> >
> > The true-to-form BIOS way would probably be to put FreeDOS,
> > loadlin.exe, kernel and initramfs into a disk image. So please don't do
> > that. If you really want to, please be rational: Ask yourself why you
> > want to first start the wrong OS in order to then start the right OS.
> >
> >
> > > How would that step go (vmlinuz -> ELF)?
> >
> > I'd recommend to study what coreboot does. It's not trivial, but also
> > not super complicated. The key point is that Linux needs a loader stub
> > (code and data) to be generated. It's not possible to just jump right
> > into the kernel and have it start. Unfortunately.
> >
> >
> > //Peter
> > _______________________________________________
> > SeaBIOS mailing list -- seabios@seabios.org
> > To unsubscribe send an email to seabios-le...@seabios.org
>
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-le...@seabios.org

Reply via email to