home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / tvrw31d.zip / DPMIUSER.DOC < prev    next >
Text File  |  1994-07-04  |  8KB  |  210 lines

  1.                      DPMI USER DOCUMENTATION
  2.                  Turbo Vision Resource WorkShop
  3.  
  4. This file documents the use of RTM.EXE, DPMI16BI.OVL. This program
  5. requires these files, but the DEMO version doesn't contain them.
  6. If you have Turbo Pascal or Borland Pascal 7.0 you will find these files
  7. on your distribution disks. I didn't include these files, because if you
  8. use this program you're required to have Turbo Pascal 7.0 with Objects.
  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. ================================================================
  26. Running a DOS Protected-Mode Program
  27. ================================================================
  28.  
  29. When you run a DOS protected-mode application, you must ensure
  30. that DPMI16BI.OVL (the DPMI server), RTM.EXE (the run-time
  31. manager), and any DLLs used by the application are present in the
  32. current directory, the same directory as the application, or on
  33. the DOS path.
  34.  
  35.  
  36. Protected Mode and Memory
  37. -------------------------
  38.  
  39. A DOS protected-mode program uses DPMI (DOS Protected Mode
  40. Interface) to run in protected mode which gives the application
  41. access to all your computer's memory. With the exceptions
  42. outlined below, the DOS protected-mode technology is completely
  43. transparent and no extra steps are necessary in order to run a
  44. protected-mode application.
  45.  
  46.  
  47. DPMIINST
  48.  
  49. One such exception might be when you run a protected-mode program
  50. for the very first time on a 286-based system. The protected mode
  51. technology uses an internal database which contains various
  52. machine characteristics to determine how to enable protected mode
  53. operation on your system, and configures itself accordingly. If
  54. you have a computer with an older 80286 microprocessor, your
  55. system might not be recognized. You'll see this message when you
  56. try to run a protected-mode application:
  57.  
  58.   Machine not in database (RUN DPMIINST)
  59.  
  60. If you get this message, simply run the DPMIINST program by
  61. typing DPMIINST at the DOS prompt and following the program's
  62. instructions.
  63.  
  64. DPMIINST runs your machine through a series of tests to determine
  65. the best way of enabling protected mode, and automatically
  66. configures accordingly. Once you have run DPMIINST, you won't
  67. have to run it again.
  68.  
  69. Some memory managers, device drivers, and memory-resident (TSR)
  70. programs can interfere with DPMIINST's ability to analyze your
  71. system. If DPMIINST fails, try temporarily disabling or removing
  72. these programs. That gives DPMIINST the unrestricted access it
  73. needs to determine the best way to enter protected mode.
  74.  
  75. Note that running DPMIINST.EXE will never be required on any
  76. system running HIMEM (or equivalent) or on any system based on
  77. an 80386 (or later) processor.
  78.  
  79.  
  80. DPMIMEM
  81.  
  82. By default, the DPMI interface allocates all available extended
  83. memory for its own use. If you don't want all of the available
  84. memory to be taken by the DPMI kernel, you can set a DOS
  85. environment variable to specify the maximum amount of memory to
  86. use. This variable can be entered directly at the DOS prompt or
  87. inserted in your AUTOEXEC.BAT file, using this syntax:
  88.  
  89.   SET DPMIMEM=MAXMEM nnnn
  90.  
  91. where nnnn is the amount of memory in kilobytes.
  92.  
  93. For example, if you have a system with 4MB and want the DPMI
  94. kernel to use only 2MB of it, leaving the other 2MB alone, the
  95. DPMIMEM variable would be set as follows:
  96.  
  97.   SET DPMIMEM=MAXMEM 2048
  98.  
  99. Some memory managers, like QEMM or 386^Max, allow allocating the
  100. same area of memory as either extended or expanded and many older
  101. applications can use only expanded memmory (EMS). By using the
  102. DPMIMEM DOS environment variable to limit the amount of extended
  103. memory used by the DPMI server, your system will still have
  104. expanded memory available for use by older applications.
  105.  
  106.  
  107. EXTENDED MEMORY
  108.  
  109. A protected-mode application interacts with the DPMI server
  110. through Borland's run-time manager (RTM.EXE). By default, a
  111. protected-mode application uses all the extended memory reserved
  112. by the DPMI kernel.
  113.  
  114.  
  115. ================================================================
  116. Running A DOS Protected-Mode Program from Windows
  117. ================================================================
  118.  
  119. A DOS protected-mode program will run in Windows in 386 enhanced
  120. mode. To configure the amount of memory available to the
  121. application, create a Windows PIF file. To learn more about PIF
  122. files, see your Microsoft Windows User's Guide.
  123.  
  124.  
  125. Running Your Program in Windows Standard Mode
  126. ---------------------------------------------
  127.  
  128. In order to run a protected-mode program from Windows
  129. standard-mode, you must set the DPMIMEM DOS environment variable
  130. and run RTMRES (both are described above) before running Windows.
  131. Make sure your DPMIMEM setting leaves enough physical memory for
  132. Windows to operate.
  133.  
  134. Note that once you've run RTMRES, you won't be able to run
  135. Windows in 386 enhanced mode until you exit the RTMRES shell (by
  136. typing EXIT at a DOS prompt).
  137.  
  138.  
  139. Running from a Windows DOS Prompt
  140. ---------------------------------
  141.  
  142. To run a DOS protected-mode application from a Windows DOS
  143. prompt, you must first modify the DOSPRMPT.PIF file found in your
  144. Windows directory so that the protected-mode program will be able
  145. to use extended memory.
  146.  
  147. Using the Windows PIF editor, open the DOSPRMPT.PIF file, and
  148. indicate the amount of extended memory you want the
  149. protected-mode program to use. If you are unsure how to use the
  150. PIF editor, see your Microsoft Windows User's Guide.
  151.  
  152.  
  153. ================================================================
  154. Controlling the Amount of Memory the Run-Time Manager Uses
  155. ================================================================
  156.  
  157. The run-time manager attempts to free as much conventional memory
  158. as possible (by moving moveable memory blocks into extended
  159. memory, for example) before starting an application. No attempt
  160. is made to release extended memory, however. Therefore, if you
  161. are going to run other protected-mode applications that don't use
  162. the run-time manager (Paradox 4.0, for example), use the RTM DOS
  163. environment variable to control the run-time manager's allocation
  164. of memory.
  165.  
  166. Use the DOS command line to add the RTM environment variable to
  167. your system's DOS environment. Here is the syntax:
  168.  
  169.   SET RTM=[option nnnn]
  170.  
  171. The following table lists the options you can use. nnnn can be a
  172. decimal number or a hex number in the form of xAB54 or xab54.
  173.  
  174.    Option          Description
  175.    -------------------------------------------------------------
  176.    EXTLEAVE nnnn   Always leave at least nnnn kilobytes of
  177.                    extended memory available. The default value
  178.                    is 640K.
  179.  
  180.    EXTMAX nnnn     Don't allocate more than nnnn kilobytes of
  181.                    extended memory. The default value is 4
  182.                    gigabytes. In Windows, the default value is
  183.                    one-half the available memory.
  184.  
  185.    EXTMIN nnnn     If fewer than nnnn kilobytes are available
  186.                    after applying EXTMAX and EXTLEAVE limits,
  187.                    terminate with an Out of Memory message. The
  188.                    default value is zero.
  189.  
  190.    REALLEAVE nnnn  Always leave at least nnnn paragraphs of real
  191.                    memory available. The default value is 64K or
  192.                    4096 paragraphs.
  193.  
  194.    REALMAX nnnn    Don't allocate more than nnnn paragraphs of
  195.                    real memory. The default value is 1 megabyte
  196.                    or 65,535 paragraphs.
  197.  
  198.    REALMIN nnnn   If fewer than nnnn paragraphs are available
  199.                   after applying REALMAX and REALLEAVE, terminate
  200.                   with an Out of Memory message. The default
  201.                   value is zero.
  202.  
  203. The following DOS command limits RTM to 2M bytes of extended
  204. memory, and ensures that 128K bytes of real memory are left
  205. unallocated:
  206.  
  207.   SET RTM=EXTMAX 2048 REALLEAVE 8192
  208.  
  209.                       *    *    *    *    *
  210.