[OpenBIOS] Why protected mode?

Brian Hurt bhurt at imageman.com
Wed Jul 7 17:58:10 CEST 1999


Sorry about the newbie questions- I still can't get at the FAQ.  Pointers
to where I can get this document gladly accepted.  Or a pointer to the
archive of this mailing list.  Or the CVS repository for the code.

Why is the bios going into protected mode?  This would seem to make life
difficult to load an OS.  Is there a game plan for dealing with this that
I'm not seeing?

The problem is that the linux load sequence is 16-bit code, which loads
the idt and gdt and then performs dozens of more instructions before going
into protected mode.

The solutions I see are: 

1) Don't go into protected mode.  So long as addresses stay below 1 meg,
this shouldn't be a problem (PCI/AGP configuration is the only reason I
know of why we may need to go above 1M).

2) Go into protected mode for initial configuration, then exit it to load
the boot code (note that the BIOS service routines would have to run in
real mode in this case).

3) Stay in protected mode, run the OS loader in V86 mode, and "cleverly"
handle the protection fauls (probably by "emulating" them- on the
lidt/gidt instructions we save off their offsets, and on the lmsw
instruction doing all three- lidt/gidt/lmsw).

4) Same as above, but instead of emulating the instructions, we exit from
protected mode at that point, and retry the instruction (and hope that no
one ever tries to use a BIOS service after executing a protected
instruction).

5) Beg the OS maintainers to change their code.  I dislike this option
intensely- while on Linux we could probably do it (by becoming OS
maintainers), I doubt Microsoft would listen.

Brian

-
To Unsubscribe: send mail to majordomo at freiburg.linux.de
with "unsubscribe openbios" in the body of the message



More information about the openbios mailing list