On Fri, 4 Jan 2002, Sean 'Captain Napalm' Conner wrote:
The 386 and above also have a virtual 8086 mode, which
allows you to
run real mode code under a protected OS---the real mode is virtualized
(to an extent, I don't think it's pure vitualizasion like you can get
on the IBM 360 line).
I believe that in virtual-8086 mode, priveleged instructions (e.g. OUT)
cause a trap. The OS, having set up the appropriate trap gates, gets
control and decides what to do for these instructions.
There is an undocumented mode---real-32 bit (where the
CPU is in
32-bit mode, but not running protected) but that's a hack and is
probably not recomended.
That's 'flat mode'. It's not a hack; it's actually the simplest way
to
set up protected mode, and requires very little work from the programmer.
Once upon a time, I built this floppy that contained a larval kernel and,
in the boot sector, a kernel loader. The only thing my 'kernel' did was
enter protected mode and print "Hello, world" on the screen. I used flat
mode.
--
Jeffrey S. Sharp
jss(a)subatomix.com