home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / msdos / misc / 6594 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  2.7 KB

  1. Path: sparky!uunet!spool.mu.edu!olivea!inews.Intel.COM!td2cad!dmarer
  2. From: dmarer@td2cad.intel.com (Dennis Marer)
  3. Newsgroups: comp.os.msdos.misc
  4. Subject: Re: Real mode / Protected mode definition?
  5. Message-ID: <BzDpJx.HIo@inews.Intel.COM>
  6. Date: 17 Dec 92 01:02:17 GMT
  7. References: <1go1kjINN986@mizar.usc.edu>
  8. Sender: news@inews.Intel.COM (USENET News System)
  9. Organization: Intel Corporation, Santa Clara, CA USA
  10. Lines: 45
  11. Nntp-Posting-Host: td2cad
  12.  
  13. In article <1go1kjINN986@mizar.usc.edu> sharp@mizar.usc.edu (Malcolm Sharp) writes:
  14. >I'd appreciate someone providing a definition of real mode and
  15. >protected mode.  I thought I understood the difference - until I
  16. >needed to explain it someone.  I looked in the MS-DOS 5.0 manual and
  17. >found nothing.  Is this something that usually involves Windows only?
  18.  
  19. Ok, I'll bite... (and have time on my hands...)
  20.  
  21. Think of 'real mode' as how the original 8086's, 8088's and 80186's ran: every
  22. segement:offset address corresponded exactly to a physical address in memory.
  23.  
  24.     0001:0000h = 0000:0010h = address 00010h in memory
  25.  
  26. In protected mode, each 'task' has its own view of the machine.  Each task also
  27. can use global data segments (found in the global descriptor table, or GDT) or
  28. local data segments (found in the LDT).  Segments in protected mode actually
  29. point to the descriptors in one of these tables, and the descriptors actually
  30. contain the physical address.  This changes the following:
  31.  
  32.     0001:0000h is probably NOT equal to 0000:0010h!!!
  33.  
  34. In this way, tasks can use global segments (from the GDT) or local segments
  35. (from the LDT).  If a segment loaded into CS,DS,ES,SS,... is NOT found in the
  36. GDT or the LDT, a violation occurs because the CPU has no way to translate
  37. the segment into an actual phsyical address via descriptors.  Another note is
  38. that two tasks may have the same segment in their LDTs pointing at different
  39. physical memory addresses!
  40.  
  41. Another feature of protected mode on the 386 and up: The offset can now be
  42. 32-bits giving each segment a 4GB ceiling (compared to the previous 64K).
  43.  
  44. If your environment uses virutal memory, then the physical addresses stored in
  45. the descriptors are actually indeces into another virtual memory lookup table.
  46. This extends this memory size (from the task's point of view) to >30 terabytes.
  47.  
  48. You can also run a 'virtual 8086' task within protected mode, which is how
  49. OS/2 can emulate a DOS machine so well...in fact, MS-DOS 5.0 is running inside
  50. a virtual 8086 task inside protected mode!  So MS-DOS does use protected mode,
  51. but there's no reason why your programs need to know this.  They'll run the
  52. same as if they were on a good old PC... :-)
  53.  
  54.                 Dennis Marer
  55.                 dmarer@td2cad.intel.com
  56.  
  57. -- Not speaking for Intel
  58.