home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / alt / msdos / programm / 2695 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  5.4 KB

  1. Path: sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!b61442.STUDENT.CWRU.Edu!sal8
  2. From: sal8@po.cwru.edu (Steve Luzynski)
  3. Newsgroups: alt.msdos.programmer
  4. Subject: Re: QEMM/386
  5. Date: Mon, 9 Nov 1992 20:39:33 GMT
  6. Organization: Case Western Reserve University
  7. Lines: 95
  8. Message-ID: <sal8.154.721341573@po.cwru.edu>
  9. References: <4141@bcstec.ca.boeing.com>
  10. NNTP-Posting-Host: b61442.student.cwru.edu
  11. Summary: What is QEMM 386 actually doing and how does it do it?
  12. Keywords: QEMM memory management 80386
  13.  
  14. In article <4141@bcstec.ca.boeing.com> silverm@bcstec.ca.boeing.com (Jeff Silverman) writes:
  15. >From: silverm@bcstec.ca.boeing.com (Jeff Silverman)
  16. >Subject: QEMM/386
  17. >Summary: What is QEMM 386 actually doing and how does it do it?
  18. >Keywords: QEMM memory management 80386
  19. >Date: 9 Nov 92 05:44:05 GMT
  20. >
  21. >I am a VAX/VMS guru in the process of becoming an MS-DOS guru.  If these
  22. >questions sound naive, it is because I am coming at these from a strange
  23. >perspective.
  24.  
  25. Not naive actually - more like questioning the lack of common sense 
  26. involved in DOS programming. Most of us have been asking the same things for 
  27. years. It's because DOS was written way back when no one could imagine 
  28. needing more than 64K of memory. To this day DOS is still configured to run 
  29. on an 8086.
  30.  
  31. >In the VAX/VMS operating system, programs execute in their own virtual address
  32. >space, which gets mapped on a page by page basis into physical memory.  2 VMS
  33. >programs can be running at the same virtual address yet address different
  34. >pages of physical memory, because the mapping is done on a per-process basis
  35. >and the OS handles all that transparently.  The programmer sees 1, big pool
  36. >of RAM.
  37.  
  38. Sounds like OS/2. :)
  39. [I am a certified OS/2 addict. I admit it.]
  40.  
  41. >What does QEMM/386 do, from a programmers point of view?  It appears to move
  42. >things around in both physical and virtual memory.  How is this possible?
  43. >If something, say, a TSR, is moved out of low memory and into either High
  44. >Memory (By high memory, I mean the region between 640K and 1 Mbyte) or extended
  45. >memory, how does it keep working?  All of the destinations for jump instructions
  46. >would change.  Or does the 80386 have additional memory relocation?
  47. >How does QuarterDeck's OPTIMIZE program work?  Please don't say it works well,
  48. >I KNOW it works well, I've been playing with it, I can see that it works, but
  49. >don't know what it's doing or how it does it.  Well, I do know what its doing,
  50. >it's modifying CONFIG.SYS to free up more RAM in the lower 640K region.
  51.  
  52. A program like a TSR would have been written from the start to execute no 
  53. matter where it gets loaded - i.e. no absolute jumps. You'd use branches if 
  54. you could or a jump table that you fill in at loadtime if not. (I'll 
  55. admit there are probably more sophisticated ways to do that. Different 
  56. strokes...I first did the jump table thing on my Apple //e... [ugh])
  57.  
  58. >Why does DOS have a 640Kbyte limit?
  59.  
  60. Ask Bill Gates. :)
  61. Seriously, it's because DOS was written for the 8086 which had a physical 
  62. address limit of 1M. (20 address lines - 2^19 = 1M.) Of this, the last 384K 
  63. was designated as for use by the operating system and by system ROMs by the 
  64. designers. (Like I said, they never dreamed people would actually have 64M 
  65. of RAM in their _desktop_ machines.) This was a convenient number since 
  66. 640K = 10 64K segments, each of which can be addressed directly with 16 
  67. bits. 
  68.  
  69. >Why would anybody ever want to use expanded RAM if extended RAM is available?
  70.  
  71. You wouldn't. It just hangs around since some older programs used it because 
  72. at the time (pre-386) it was the only option. And there _are_ still people 
  73. with big expanded memory cards in their machines that would whine 
  74. incessantly if they were told to join the late 80's and chuck them.
  75.  
  76. >If I have a "C" program which runs properly under VMS, but needs, say, 3 Mbytes
  77. >of RAM to store all its data structures, what is the best way to run it under
  78. >DOS?  Under Windows?
  79.  
  80. Under DOS I would go for overlays. Either to XMS or to disk, depending on 
  81. what's available and how nice of a pre-built overlay manager you use.
  82.  
  83. Under Windows all you have to do is ask the Windows memory manager for the 
  84. memory. It does the virtual remapping thing you were talking about.
  85.  
  86. Under OS/2 you also just ask for it. You can get all the physical RAM you 
  87. want plus as much virtual as the user has room for on their HD. Plus you 
  88. don't have to deal with segmented addressing (which is really irritating to 
  89. have to deal with under DOS and, to some extent, Windows.).
  90.  
  91. Really the nicest thing that QEMM does for the DOS user is pool all physical 
  92. memory and reallocate whatever is needed to running programs as whatever 
  93. type they want. In theory all of the other features are already in DOS 
  94. (except for the stealth feature) - they're just better implemented under 
  95. QEMM. (or 386Max for that matter)
  96.  
  97. Good luck with your quest. If you need more I'm sure someone else (or me for 
  98. that matter) can fill in the gaps.
  99.  
  100. ----------------------------------------------------------------------------
  101. Steve Luzynski @ Case Western Reserve University in Cleveland, OH
  102. sal8@po.cwru.edu             | voice calls cheerlessly accepted at x2153.
  103. ----------------------------------------------------------------------------
  104. current mental status: more or less at peace with the world, all things 
  105. considered.
  106. ----------------------------------------------------------------------------
  107. this post was written while i should have been doing homework. therefore,
  108. you are indirectly responsible for my current gpa, such as it is.
  109.