[LinuxBIOS] LinuxBIOS and FreeBSD
Philip Schulz
phs at deadc0.de
Fri Oct 26 08:34:27 CEST 2007
Am 26.10.2007 02:07, Peter Stuge schrieb:
> On Thu, Oct 25, 2007 at 04:44:28PM +0200, Philip Schulz wrote:
>> I recently played around with LinuxBIOS and FreeBSD. In short, it
>> somewhat works in QEMU using ADLO
>
> Cool!
>
>
> Do you know the FBSD boot process internals well?
>
No, I'm still learning.
> I discussed this at Linuxforum.dk this spring with some FBSD people
> and have a contact I can dig up if you want to pick up the ball.
>
I'm afraid I've just started so I might not even be qualified to ask
good questions. But thanks for the offer anyways, I might get back to
you once I've made some progress.
> The idea is to short-circuit all the BIOS junk that ADLO emulates and
> have LB/elfboot/FILO start the kernel directly, as is done with
> Linux.
>
> Since the *BSD boot process is split into several steps that may not
> be quite as easy as with Linux however.
>
Yes, the FreeBSD/i386 boot process is split into several steps. FWIW,
there's a man page describing the boot process at [1].
While you could probably use the FreeBSD kernel as a payload to
LinuxBIOS, I don't think it would be a good idea. First, the FreeBSD
GENERIC kernel, i.e. default kernel, is about 8.6 MBytes. The size could
be reduced by removing drivers and options, but then it'd still be a few
MBytes in size. Maybe gzipping the kernel image would work, I don't
know. But there's a second and more important reason not to boot the
kernel directly: The FreeBSD kernel doesn't understand command line
options like "--init=/bin/sh" which I think the Linux kernel does.
Instead, the FreeBSD kernel relies on a little program called "loader"
to supply it with boot time options, e.g. selecting the default console
or telling the kernel to boot in single-user mode. Also, the loader
takes care of loading kernel modules at boot time. The loader will look
for options in a file called /boot/loader.conf, parse it and then load
the kernel from /boot/kernel/kernel. Obviously, the loader has to
understand a fair amount of UFS in order to do that.
So in short, I think the loader should be used as a LinuxBIOS payload
instead of the kernel (which is what I'm going to try one of these
days). I'm no expert though, so I might be wrong.
Regards,
Philip
[1]http://www.freebsd.org/cgi/man.cgi?query=boot&apropos=0&sektion=0&manpath=FreeBSD+7-current&format=html
More information about the coreboot
mailing list