Re: [RFC] x86 ELF bootable kernels/Linux booting Linux/LinuxBIOS

Werner Almesberger
2002-02-04T21:04:00Z

Eric W. Biederman wrote:
> I have come to agree with this sentiment.

Great !

> However I do have a small issue with the current bootimg api.
> Everything is done in page sized chunks. Which feels like it is
> exporting too much of the current implementation.

Well, it keeps things simple for the kernel, and bootimg(8) needs
to know the target architecture anyway. But there isn't really a
design reason why it would have to use pages, agreed.

> Except for the case of Loadlin where the old firmware is destroyed,
> and you cannot requery the firmware. You have a more robust solution
> if you let the new kernel query the firmware itself.

Yes, I was thinking of
- BIOS does IDE bus scan, boots boot loader kernel
- first kernel does IDE bus scan again, boots real kernel
- real kernel does IDE bus scan again

It should be possible to avoid at least the third IDE bus scan, at
least as an optimization.

> For the most part I agree, that the bootimg type interface will avoid
> bloat. At the same time, some of this information that we would like
> to pass is easier to get at in kernel space, oh well.

You can always look it up in /dev/mem, just like bootimg(1) did :-)
BTW, that's what I like about this approach: incremental development
is much easier this way, and you can hide all the ugly spots in the
library, if necessary.

> I will stop just a moment to say it is extremely nasty to read the ELF
> section header instead of the ELF program header for boot purposes.
> For an ELF static executable it is totally valid not to have a section
> header.

Touche ;-) I admit that I'm not much of an ELF expert. This was just
a surprisingly easy hack, so I was content with what I got.

- Werner

--
_________________________________________________________________________
/ Werner Almesberger, Lausanne, CH wa@almesberger.net /
/_http://icawww.epfl.ch/almesberger/_____________________________________/