home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / DOS / UTILITY / GEHEUGEN / UMBGWJ10 / UMB.DOC < prev   
Text File  |  1994-11-29  |  7KB  |  157 lines

  1.     UMB_GWJ.SYS - An Upper Memory Manager for MS-DOS
  2.                           Version 1.0
  3.  
  4. UMB_GWJ.SYS allows you to register available memory above the 640KB boundary
  5. but below the 1MB start of extended memory.  Once this memory is registered
  6. by UMM.SYS, it becomes available for use by MS-DOS applications, or by
  7. MS-DOS itself.
  8.  
  9. Memory above the 640KB base memory boundary but below the High Memory Area
  10. (HMA) and extended memory is called Upper Memory, and is grouped into one
  11. or more Upper Memory Blocks (UMBs).
  12.  
  13. UMB can be provided on 386+ by memory managers such as EMM386.EXE
  14. or QEMM386.SYS, which switch the processor into virtual 8086 mode and use
  15. mapping capabilities of processor itself. This approach has this
  16. advantage, that it is independent from the mainboard design, but also has
  17. some disadvantages:
  18. 1) Switching into v8086 mode slows down your computer.
  19. 2) You cannot use td386.exe and tdh386.sys.
  20. 3) There are some programs which refuse to work in protected mode.
  21.  
  22. The approach of using available memory (usually SHADOW RAM) has the following
  23. advantages:
  24. 1) Uses memory which normally would be left unused.
  25. 2) Does not allocate any memory (or maybe about 80 bytes on some
  26. computers). 
  27. 3) TD386.EXE can be used.
  28. 4) You are able to load TD386.SYS and HIMEM.SYS high.
  29.  
  30. This version is limited to HT-320 chipset, but if you know how to enable
  31. SHADOW RAM for writing in your computer, you can easily adapt it.
  32.  
  33. Installation.
  34. Driver UMB_GWJ.SYS is installed in CONFIG.SYS. It must be run before
  35. HIMEM.SYS and every program you want to place in UMB. The program
  36. parameters specify UMB areas which you want to make available, e.g.
  37. UMB_GWJ.SYS c800-F800 FB00-FC00
  38. means that regions from C800:0 inclusive to F800:0 exclusive
  39. and FB00:0 inclusive to FC00:0 exclusive will be available.
  40. In CONFIG.SYS you also must place the line
  41. DOS = UMB
  42. or 
  43. DOS = HIGH,UMB.
  44.  
  45. You must enable SHADOW RAM for the areas you wish to use or
  46. disable memory remapping in CMOS SETUP. This is essential. If you do not
  47. do so, you may observe that the same memory is visible under two addresses
  48. - at the end of XMS and in UMB. This may lead to some unpredictable
  49. behavior of your computer. 
  50. It may be also necessary to place an EMMexclude line in SYSTEM.INI
  51. for the regions you are enabling if 386ENHANCED mode of Windows 3.1 
  52. is used.
  53.  
  54. This is the exemplary CONFIG.SYS contents:
  55.  
  56. DOS = HIGH, UMB
  57. DEVICE = C:\UTIL\UMB_GWJ.SYS C800-F800
  58. REM we load XMS manager to UMB
  59. DEVICEHIGH = C:\UTIL\HIMEM.SYS
  60. REM other programs we wish to install in UMB
  61. DEVICEHIGH = ...
  62. INSTALLHIGH = ...
  63.  
  64. Note, that in MS-DOS 6.x you can use "/L:" parameters.
  65.  
  66. How does it work.
  67. 1) UMB_GWJ is run during system initialization when CONFIG.SYS is
  68. interpreted. It must be the first XMS server.
  69.  
  70. 2) Program enables SHADOW RAM for writing and copies part of its code into
  71. the first specified UMB. If this area is too small, error message is
  72. written to the console and program exits. Otherwise 2Fh interrupt vector
  73. is intercepted by the part resident in UMB. Part of the program resident
  74. in low memory is removed by DOS.
  75.  
  76. 3) After installation of every driver DOS checks, if XMS driver providing
  77. UMB is installed. Resident portion of UMB_GWJ.SYS will return the positive
  78. result of this test.
  79.  
  80. 4) After returning all the block addresses driver releases interrupt 2F
  81. and returns the information, that there are no more UMB available.
  82.  
  83. 5) At this moment driver is no more needed, and because it hasn't
  84. allocated any memory block, it will be overwritten by the first program
  85. installed in UMB.
  86.   
  87. Notes:
  88. 1) When you define DEBUG during compilation, you may observe how the driver
  89. is working.
  90. 2) At the beginning of the driver some space is reserved for DOS memory block
  91. header. 
  92. 3) Driver tries to detect lack of DOS=UMB line in CONFIG.SYS.
  93. Unfortunately, it works only in DOS 5.0 due to the minor change in XMS
  94. detection algorithm in newer versions of DOS.
  95. 4) EMM386.EXE can be used together with UMB_GWJ.SYS. It allows for
  96. enabling and disabling EMS what is not possible, when EMM386 provides UMB.
  97. If you load EMM386.EXE to UMB you must ensure, that EMS page frame is
  98. above the EMM386.EXE program area. On my computer I found out, that the
  99. first half of ROM-BIOS is unused, so I placed page frame at E800. It was
  100. not possible explicitely, but I accomplished it using I and X options -
  101. I have excluded areas used by UMB_GWJ and included E800-E7FF area.
  102.  
  103. Compilation:
  104. TASM UMB_GWJ.ASM
  105. TLINK /t UMB_GWJ, UMB_GWJ.SYS
  106.  
  107.  
  108. Notes on porting to other chipsets.
  109. 1) You must change the SHADOW RAM enabling procedure. You may also use
  110. external driver to do so loaded before UMB_GWJ.SYS.
  111. 2) On some computers unused SHADOW RAM area is remapped to extended
  112. memory. Enabling it causes, that the same area of memory is visible at two
  113. addresses or that the access to the final part of extended memory is
  114. impossible. You must inform all the programs about it. It can be done by
  115. intercepting 15h interrupt function regarding extended memory size and
  116. modify word field at 45H of undocumented LL structure (pointer to this
  117. structure is returned in ES:BX by int 21h function 52h). Exemplary
  118. program to be loaded immediately after UMB_GWJ is included in this
  119. package. 
  120.  
  121. Notes on DMA usage.
  122. On some computers DMA access to UMB obtained by SHADOW RAM enabling is not
  123. possible. Even if it is possible in some cases errors may occur. It is
  124. related to ISA bus construction. If in the same 128KB area that UMB blocks
  125. there is 16 bit I\O device memory, it can happen, that 8 bit DMA transfer
  126. will be treated by such a device as an access to its memory and I/O cycle
  127. will be switched into 16 bit mode. So happens, if error occurs during
  128. reading of unbuffered A0-A16 address lines. It causes, that every other
  129. transferred byte is 255. Such errors may occur in areas A000-BFFF,
  130. C000-DFFF and E000-FFFF.
  131. There is video memory in first area and it is usually not used for UMB.
  132. In second area Video BIOS is mapped. We may switch it into 8-bit mode
  133. or disable it. I know how to do it for Trident cards. When you disable
  134. BIOS it may be necessary to always use hard reboot instead of soft one.
  135. Third area contains system BIOS. Because it is not located on the
  136. extension card, it shouldn't cause problems.
  137.  
  138. WARNING!!
  139. DMA errors or lack of DMA access may cause erroneous data writes to the
  140. diskette if:
  141. - SMARTDRV is used for diskette caching and it is located in UMB.
  142. - DOS Transfer Buffer is moved to UMB
  143.  
  144. How to contact author.
  145.  
  146. Send a mail to Internet address
  147. gwj@j-23.p.lodz.pl
  148.   
  149. Acknowledgements:
  150. I would like to thank Kenneth Gober for his upper memory manager. It has given
  151. me the stimulus to interest in memory optimizing.
  152.  
  153.  
  154.  
  155.  
  156.  
  157.