home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PCGPEV10.ZIP / DPMIUSER.DOC < prev    next >
Text File  |  1992-10-27  |  10KB  |  245 lines

  1.                      DPMI USER DOCUMENTATION
  2.                  Borland Pascal With Objects 7.0
  3.  
  4. This file documents the use of RTM.EXE, RTMRES.EXE, DPMI16BI.OVL,
  5. DPMIINST.EXE and DPMILOAD.EXE is intended for redistribution
  6. under the terms of the license statement accompanying this
  7. product. Modify and use this text to provide information to users
  8. of your protected-mode applications.
  9.  
  10. Included is documentation about these topics:
  11.  
  12.   o Running a DOS Protected-Mode Program
  13.  
  14.   o What to do if Borland's DPMI server does not run on your
  15.     system
  16.  
  17.   o How to set DOS environment variables that affect all
  18.     protected-mode programs generated by Borland Pascal with
  19.     Objects 7.0
  20.  
  21.   o Special notes for running under Windows
  22.  
  23.   o Controlling the amount of memory the run-time manager uses
  24.  
  25.   o Special note for Borland C++ and Paradox 4.0 users
  26.  
  27. ================================================================
  28. Running a DOS Protected-Mode Program
  29. ================================================================
  30.  
  31. When you run a DOS protected-mode application, you must ensure
  32. that DPMI16BI.OVL (the DPMI server), RTM.EXE (the run-time
  33. manager), and any DLLs used by the application are present in the
  34. current directory, the same directory as the application, or on
  35. the DOS path.
  36.  
  37.  
  38. Protected Mode and Memory
  39. -------------------------
  40.  
  41. A DOS protected-mode program uses DPMI (DOS Protected Mode
  42. Interface) to run in protected mode which gives the application
  43. access to all your computer's memory. With the exceptions
  44. outlined below, the DOS protected-mode technology is completely
  45. transparent and no extra steps are necessary in order to run a
  46. protected-mode application.
  47.  
  48.  
  49. DPMIINST
  50.  
  51. One such exception might be when you run a protected-mode program
  52. for the very first time on a 286-based system. The protected mode
  53. technology uses an internal database which contains various
  54. machine characteristics to determine how to enable protected mode
  55. operation on your system, and configures itself accordingly. If
  56. you have a computer with an older 80286 microprocessor, your
  57. system might not be recognized. You'll see this message when you
  58. try to run a protected-mode application:
  59.  
  60.   Machine not in database (RUN DPMIINST)
  61.  
  62. If you get this message, simply run the DPMIINST program by
  63. typing DPMIINST at the DOS prompt and following the program's
  64. instructions.
  65.  
  66. DPMIINST runs your machine through a series of tests to determine
  67. the best way of enabling protected mode, and automatically
  68. configures accordingly. Once you have run DPMIINST, you won't
  69. have to run it again.
  70.  
  71. Some memory managers, device drivers, and memory-resident (TSR)
  72. programs can interfere with DPMIINST's ability to analyze your
  73. system. If DPMIINST fails, try temporarily disabling or removing
  74. these programs. That gives DPMIINST the unrestricted access it
  75. needs to determine the best way to enter protected mode.
  76.  
  77. Note that running DPMIINST.EXE will never be required on any
  78. system running HIMEM (or equivalent) or on any system based on
  79. an 80386 (or later) processor.
  80.  
  81.  
  82. DPMIMEM
  83.  
  84. By default, the DPMI interface allocates all available extended
  85. memory for its own use. If you don't want all of the available
  86. memory to be taken by the DPMI kernel, you can set a DOS
  87. environment variable to specify the maximum amount of memory to
  88. use. This variable can be entered directly at the DOS prompt or
  89. inserted in your AUTOEXEC.BAT file, using this syntax:
  90.  
  91.   SET DPMIMEM=MAXMEM nnnn
  92.  
  93. where nnnn is the amount of memory in kilobytes.
  94.  
  95. For example, if you have a system with 4MB and want the DPMI
  96. kernel to use only 2MB of it, leaving the other 2MB alone, the
  97. DPMIMEM variable would be set as follows:
  98.  
  99.   SET DPMIMEM=MAXMEM 2048
  100.  
  101. Some memory managers, like QEMM or 386^Max, allow allocating the
  102. same area of memory as either extended or expanded and many older
  103. applications can use only expanded memmory (EMS). By using the
  104. DPMIMEM DOS environment variable to limit the amount of extended
  105. memory used by the DPMI server, your system will still have
  106. expanded memory available for use by older applications.
  107.  
  108.  
  109. RTMRES
  110.  
  111. RTMRES preloads the protected-mode system. Preloading the DPMI
  112. server lets you load a protected-mode program slightly faster.
  113. RTMRES will start a program if you specify a program name as a
  114. parameter. If no parameter is specified, RTMRES will run a DOS
  115. shell. Type EXIT to close the shell.
  116.  
  117. RTMRES is especially useful if you start, exit, and start a
  118. protected-mode program frequently. Normally, every time you run a
  119. protected-mode application, the DPMI server is loaded. If you've
  120. run RTMRES previously, the server is already present, and the
  121. protected-mode application loads faster.
  122.  
  123.  
  124. EXTENDED MEMORY
  125.  
  126. A protected-mode application interacts with the DPMI server
  127. through Borland's run-time manager (RTM.EXE). By default, a
  128. protected-mode application uses all the extended memory reserved
  129. by the DPMI kernel.
  130.  
  131.  
  132. ================================================================
  133. Running A DOS Protected-Mode Program from Windows
  134. ================================================================
  135.  
  136. A DOS protected-mode program will run in Windows in 386 enhanced
  137. mode. To configure the amount of memory available to the
  138. application, create a Windows PIF file. To learn more about PIF
  139. files, see your Microsoft Windows User's Guide.
  140.  
  141.  
  142. Running Your Program in Windows Standard Mode
  143. ---------------------------------------------
  144.  
  145. In order to run a protected-mode program from Windows
  146. standard-mode, you must set the DPMIMEM DOS environment variable
  147. and run RTMRES (both are described above) before running Windows.
  148. Make sure your DPMIMEM setting leaves enough physical memory for
  149. Windows to operate.
  150.  
  151. Note that once you've run RTMRES, you won't be able to run
  152. Windows in 386 enhanced mode until you exit the RTMRES shell (by
  153. typing EXIT at a DOS prompt).
  154.  
  155.  
  156. Running from a Windows DOS Prompt
  157. ---------------------------------
  158.  
  159. To run a DOS protected-mode application from a Windows DOS
  160. prompt, you must first modify the DOSPRMPT.PIF file found in your
  161. Windows directory so that the protected-mode program will be able
  162. to use extended memory.
  163.  
  164. Using the Windows PIF editor, open the DOSPRMPT.PIF file, and
  165. indicate the amount of extended memory you want the
  166. protected-mode program to use. If you are unsure how to use the
  167. PIF editor, see your Microsoft Windows User's Guide.
  168.  
  169.  
  170. ================================================================
  171. Controlling the Amount of Memory the Run-Time Manager Uses
  172. ================================================================
  173.  
  174. The run-time manager attempts to free as much conventional memory
  175. as possible (by moving moveable memory blocks into extended
  176. memory, for example) before starting an application. No attempt
  177. is made to release extended memory, however. Therefore, if you
  178. are going to run other protected-mode applications that don't use
  179. the run-time manager (Paradox 4.0, for example), use the RTM DOS
  180. environment variable to control the run-time manager's allocation
  181. of memory.
  182.  
  183. Use the DOS command line to add the RTM environment variable to
  184. your system's DOS environment. Here is the syntax:
  185.  
  186.   SET RTM=[option nnnn]
  187.  
  188. The following table lists the options you can use. nnnn can be a
  189. decimal number or a hex number in the form of xAB54 or xab54.
  190.  
  191.    Option          Description
  192.    -------------------------------------------------------------
  193.    EXTLEAVE nnnn   Always leave at least nnnn kilobytes of
  194.                    extended memory available. The default value
  195.                    is 640K.
  196.  
  197.    EXTMAX nnnn     Don't allocate more than nnnn kilobytes of
  198.                    extended memory. The default value is 4
  199.                    gigabytes. In Windows, the default value is
  200.                    one-half the available memory.
  201.  
  202.    EXTMIN nnnn     If fewer than nnnn kilobytes are available
  203.                    after applying EXTMAX and EXTLEAVE limits,
  204.                    terminate with an Out of Memory message. The
  205.                    default value is zero.
  206.  
  207.    REALLEAVE nnnn  Always leave at least nnnn paragraphs of real
  208.                    memory available. The default value is 64K or
  209.                    4096 paragraphs.
  210.  
  211.    REALMAX nnnn    Don't allocate more than nnnn paragraphs of
  212.                    real memory. The default value is 1 megabyte
  213.                    or 65,535 paragraphs.
  214.  
  215.    REALMIN nnnn   If fewer than nnnn paragraphs are available
  216.                   after applying REALMAX and REALLEAVE, terminate
  217.                   with an Out of Memory message. The default
  218.                   value is zero.
  219.  
  220. The following DOS command limits RTM to 2M bytes of extended
  221. memory, and ensures that 128K bytes of real memory are left
  222. unallocated:
  223.  
  224.   SET RTM=EXTMAX 2048 REALLEAVE 8192
  225.  
  226.  
  227. ================================================================
  228. Important Note for Borland C++ and Paradox 4.0 Users
  229. ================================================================
  230.  
  231. The DPMILOAD.EXE and DPMI16BI.OVL files provided in this package
  232. replace the older ones that came with Paradox 4.0 and BC++ 3.0 or
  233. later. Delete or rename the older versions and make sure the
  234. newer ones are on your DOS path (both Paradox and BC will search
  235. the path and find the newer versions).
  236.  
  237. If you plan to shell out from Paradox or BC++ to run another
  238. protected-mode application, first limit the amount of extended
  239. memory used by Paradox or BC++. For Paradox, use its /extk
  240. command-line parameter; and for BC++, use its /x command-line
  241. parameter. Refer to the Paradox or BC++ documentation for more
  242. information on the use of command-line options.
  243.  
  244.                       *    *    *    *    *
  245.