Re: Kernels > 1M

H. Peter Anvin (hpa@transmeta.com)
Mon, 09 Aug 1999 11:08:48 -0700


Werner Almesberger wrote:
>
> H. Peter Anvin wrote:
> > No, that's not really true. The BIOS is still necessary (like it or
> > not) -- it's the only way to access devices (disks, mainly) until actual
> > device drivers can be loaded. It is not just a matter of information --
> > it's a matter of CODE.
>
> Sure ... but that's not what I meant. Linux interacts with the BIOS in
> the following ways:
>
> 1) boot loading
> 2) retrieval of system parameters for later use by the kernel (e.g.
> VGA, SMP EBDA, ...)
> 3) services provided to the running system (e.g. APM)
>
> With my proposed extension, 1) stays roughly the same, to load the
> "second stage" kernel. The good news is of course that all the
> restrictions that apply to 1) (e.g. the dreaded 1024 cylinder limit
> or subtle EDD restrictions which kick in once you overcome the limit)
> no longer affect the entire boot process.
>
> For all further kernels (until the next reboot), a Linux kernel
> performs the duties of 1). Most of the information in 2) is
> overwritten by the running kernel, so we need to preserve that,
> because the next kernel(s) need that information too. Finally, 3) is
> there anyway, so no special treatment is needed for that.

That part shouldn't be too hard: most of the parameters passed from
setup.S to the main kernel are passed in a parameter block; one option
is to enter the new kernel at the 32-bit entry point and simply skip
setup.

However, this doesn't guarantee that the new kernel isn't going to choke
on the hardware configuration, which is going to be radically different
than a machine that has been booted from reset.

> Adapting 2) is really where the bulk of the work is.
>
> > I have considered that as well. Unfortunately, it seems like just as
> > big a project.
>
> A few years ago, a friend implemented something like this on Amiga-SVR4
> within a few days, so it doesn't seem to be all that bad, even if you
> take into account that Linux probably has a much wider interface to the
> BIOS than SVR4 had to whatever low-level environment the Amiga had.

Right, but I don't think it solves any real problem, however. What I
was trying to do was to see if you could run a Linux kernel on top of
the BIOS; it certainly is doable (Ross Biro did such an implementation
back in 1994), but I ended up believing that it was more trouble than
it's worth... in no small part because the things you have to break in
order to keep the BIOS alive pretty much breaks the native device
drivers in more-or-less subtle ways, because Linux likes to reconfigure
the hardware to act sanely.

Hence, it is not so much the BIOS interface that's the problem, but the
fact that Linux really likes to break the BIOS, and break it pretty
hard.

-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/