Re: Booting a modular kernel through a multiple streams file / Making Linux multiboot capable and grub loading kernel modules at boot time.

Eric W. Biederman
2001-12-21T16:59:19Z

"H. Peter Anvin" <hpa@zytor.com> writes:

> Eric W. Biederman wrote:
>
> > Agreed. And to completely dispel the myth. Etherboot has been doing
> > something similar for years. It disables interrupts in 32bit mode so
> > it doesn't have quite as much work to do but otherwise it is pretty
> > much the same picture.
> >
>
>
> If you disable interrupts in 32-bit mode a lot of things will not work.

The basic technique use by etherboot is:
In 32bit mode handle no interrupts. When you want to do a BIOS call
switch to 16bit mode enable interrupts do the call. disable interrupts
and switch back to 32bit mode.

As far as I can tell this is a similar idea to what you are doing in
genesis. etherboot doesn't need everything so it doesn't handle the
general case. But given that it is public program, I mentioned it
because to help dispell the myth that you can do bios call from 32 bit
protected mode..

> > I finally tracked down the reason why Setup.S is run in real mode,
> > instead of being called from protected mode. And that is in extremely
> > hostile environments (like loadlin works in) loading the kernel wrecks
> > the firmware callbacks. So you must do your BIOS calls as a special
> > case before you switch to protected mode.
>
>
> No, it's because it was easier to do it that way -- do all BIOS calls once and
> for all in the early part of the execution of the kernel, and then forget about
> it.

That may have been the original reason. But the reason to keep the
code that way is so we work with loadlin, (and any kin it might have).

I have tested it and after you are loaded by loadlin you cannot go
back and make BIOS calls. The problem is that dos TSR's and device
drivers have intercepted BIOS interrupts, and we stomp all over
those.

It may be possible to overcome this by saving the state of the entire
dos session but to be safe we would need to take a core dump of the
entire machine. And for such little gain I don't think that is worth
it.

Eric