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