🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.misc
Article #3063

Re: Real mode / Protected mode definition?

#3063
From: Dennis Marer
Date: Thu, 17 Dec 1992 01:02
45 lines
2775 bytes
In article <1go1kjINN986@mizar.usc.edu> sharp@mizar.usc.edu (Malcolm Sharp) writes:
>I'd appreciate someone providing a definition of real mode and
>protected mode.  I thought I understood the difference - until I
>needed to explain it someone.  I looked in the MS-DOS 5.0 manual and
>found nothing.  Is this something that usually involves Windows only?

Ok, I'll bite... (and have time on my hands...)

Think of 'real mode' as how the original 8086's, 8088's and 80186's ran: every
segement:offset address corresponded exactly to a physical address in memory.

	0001:0000h = 0000:0010h = address 00010h in memory

In protected mode, each 'task' has its own view of the machine.  Each task also
can use global data segments (found in the global descriptor table, or GDT) or
local data segments (found in the LDT).  Segments in protected mode actually
point to the descriptors in one of these tables, and the descriptors actually
contain the physical address.  This changes the following:

	0001:0000h is probably NOT equal to 0000:0010h!!!

In this way, tasks can use global segments (from the GDT) or local segments
(from the LDT).  If a segment loaded into CS,DS,ES,SS,... is NOT found in the
GDT or the LDT, a violation occurs because the CPU has no way to translate
the segment into an actual phsyical address via descriptors.  Another note is
that two tasks may have the same segment in their LDTs pointing at different
physical memory addresses!

Another feature of protected mode on the 386 and up: The offset can now be
32-bits giving each segment a 4GB ceiling (compared to the previous 64K).

If your environment uses virutal memory, then the physical addresses stored in
the descriptors are actually indeces into another virtual memory lookup table.
This extends this memory size (from the task's point of view) to >30 terabytes.

You can also run a 'virtual 8086' task within protected mode, which is how
OS/2 can emulate a DOS machine so well...in fact, MS-DOS 5.0 is running inside
a virtual 8086 task inside protected mode!  So MS-DOS does use protected mode,
but there's no reason why your programs need to know this.  They'll run the
same as if they were on a good old PC... :-)

				Dennis Marer
				dmarer@td2cad.intel.com

-- Not speaking for Intel
Technical Details
Message-ID: <BzDpJx.HIo@inews.Intel.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!olivea!inews.Intel.COM!td2cad!dmarer
References: <1go1kjINN986@mizar.usc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!olivea!inews.Intel.COM!td2cad!dmarer
From: dmarer@td2cad.intel.com (Dennis Marer)
Newsgroups: comp.os.msdos.misc
Subject: Re: Real mode / Protected mode definition?
Message-ID: <BzDpJx.HIo@inews.Intel.COM>
Date: 17 Dec 92 01:02:17 GMT
References: <1go1kjINN986@mizar.usc.edu>
Sender: news@inews.Intel.COM (USENET News System)
Organization: Intel Corporation, Santa Clara, CA USA
Lines: 45
Nntp-Posting-Host: td2cad