Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Apr 2003 15:14:49 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Toerless Eckert <eckert@i4.informatik.uni-erlangen.de>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: boot2 broken ? (booting from pst fails)
Message-ID:  <XFMail.20030414151449.jhb@FreeBSD.org>
In-Reply-To: <200304141600.SAA21075@faui40p.informatik.uni-erlangen.de>

next in thread | previous in thread | raw e-mail | index | archive | help

On 14-Apr-2003 Toerless Eckert wrote:
>> > - Why is the BIOS routine not run in real mode ? Would it be hard trying
>> >   to change BTX so that it executes the interrupt in real mode ?
>> 
>> Yes.  Not to mention lack of space in boot2 for BTX to grow to support this.
> 
> With boot2 being space challenged, why does it need to be a btx
> client anyhow ?

Because then the code to read UFS can be in C instead of assembly. :)  Are
you offering to rewrite the entire bootstrap in assembly and maintain it?
Note that /boot/loader also uses BTX and vm86 mode to read the kernel off
of disk and into memory > 1 meg, so you'd have to reimplement all of that
(including the Forth support, etc.) in asm as well.  Either that or try
to bounce back into real mode for any BIOS calls, as well as for any
hardware interrupts.

>> > - Is there actually a requirement for a BIOS to work correctly
>> >   in virtual mode ? I was under the assumption that BIOS is always
>> >   only assumed to need to work correctly in real mode. If this is
>> >   not true, then i would welcome if you could point me to an official
>> >   PC98, .. (or whatever) document WIntel , or
>> >   whoever leads the conspiracy what officially are requirements for a "PC").
> 
> Is there an official answer to to this ? I am still under the assumption
> that officially BIOS code is assumed only to be executed under real mode.
> I can perfectly fine understand that maybe the maority of simple BIOS pieces
> for "normal" boot hardware may be so "simple" that they even perate under
> virtual mode, but that isn't a good argument to expect all BIOS code to
> execute from virtual mode, or is it ?

Well, considering there is no "official" standard for a BIOS (if you find
one, please let us know) then it is hard there there to be an "official"
policy of discouraging use of PM directly in BIOS routines.  In reality,
very few BIOS's have these types of problems.  pst(4) is one of the few
that doesn't work in this model.  Also, I do know of at least one BIOS
vendor I worked with recently to straighten out some kinks with BTX that
specifically checks to see if they are in VM86 mode when executing in order
to handle some special cases.

>> >   Without such a reference i think anybody would have a hard time arguing
>> >   the case of requesting support for virtual mode from the BIOS of some
>> >   HW vendor, right ?
>> 
>> Basically, the only problems we have with BIOS's usually happen because the
>> BIOS writer thought they could be cute by entering protected mode themselves
>> instead of using the defined BIOS calls (such as int 0x15, function 0x87) to
>> access upper memory, etc.
> 
> I can believe that. But you also know that most exotic hardware by
> itself will not officially support FreeBSD even though someone like sos
> may have written a cool driver for it. ANd if then FreeBSD is the only OS
> with such requirements against the BIOS of add-on hardware and neither
> any windows nor Linux has it - that makes FreeBSD painting itself in a
> corner where boot-compatibility is lower than necessary. No such vendor
> would change their BIOS for it! Why not rather stick to requirements against
> the hardware that are known also to be needed by unfortunately better
> supported OSs ? Why not at least have an option for a boot process that
> does so ? Eg: I can find a replacement for boot2 easily, but how can i
> get the kernel nowadays booted without loader in between ?

Actually, some vendors have fixed their BIOS drivers in the past. :)  If
Promise does not wish to fix their BIOS, then either buy some other product
without these issues or use a standalone hard drive, CD, floppy, or network
boot to load the kernel.

> When was actually this btx client concept introduced in FreeBSD ? Eg:
> wasn't the bootstrap in before the kernel real-mode up until
> BSD 4.x ?

It might have been 4.0, yes.  4.0 came out in the previous millenium
however, and we haven't really had major issues with it.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20030414151449.jhb>