Debian Codegraph @

ibmpc/dos/wat10/wcc386/dos4gw.doc

raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14 DOS/4GW Configuration Guide
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 WATCOM International Corporation
44
45
46
47
48 Waterloo, Ontario, Canada
49
50
51 1 Configuring DOS/4GW
52
53
54 This chapter explains how to use the DOS4G environment variable to
55 suppress the banner that is displayed by DOS/4GW at startup. It also
56 explains how to use the DOS16M environment variable to select the switch
57 mode setting, if necessary, and to specify the range of extended memory in
58 which DOS/4GW will operate. DOS/4GW is based on Rational Systems' DOS/16M
59 16-bit Protected-Mode support; hence the DOS16M environment variable name
60 remains unchanged.
61
62 1.1 Suppressing the DOS/4GW Banner
63
64 The banner that is displayed by DOS/4GW at startup can be suppressed by
65 issuing the following command:
66
67 set DOS4G=quiet
68
69 Do not insert a space between DOS4G and the equal sign. A space to the
70 right of the equal sign is optional.
71
72 1.2 Changing the Switch Mode Setting
73
74 In almost all cases, DOS/4GW programs can detect the type of machine that
75 is running and automatically choose an appropriate real- to protected-mode
76 switch technique. For the few cases in which this default setting does
77 not work we provide the DOS16M DOS environment variable, which overrides
78 the default setting.
79
80 Change the switch mode settings by issuing the following command:
81
82 set DOS16M=value
83
84 Do not insert a space between DOS16M and the equal sign. A space to the
85 right of the equal sign is optional.
86
87 The table below lists the machines and the settings you would use with
88 them. Many settings have mnemonics, listed in the column "Alternate
89 Name", that you can use instead of the number. Settings that you must set
90 with the DOS16M variable have the notation req'd in the first column.
91 Settings you may use are marked option, and settings that will
92 automatically be set are marked auto.
93
94
95
96
97
98
99
100
101
102 Changing the Switch Mode Setting 1 Chapter 1
103 -------------------------------------------------------------------------------
104
105 +-------+---------------+-------+----------+-----------------------------------+
106 | | | |Alternate | |
107 |Status |Machine |Setting|Name |Comment |
108 +-------+---------------+-------+----------+-----------------------------------+
109 |auto |386/486 w/ DPMI|0 |None |Set automatically if DPMI is active|
110 |req'd |NEC 98-series |1 |9801 |Must be set for NEC 98-series |
111 |auto |PS/2 |2 |None |Set automatically for PS/2 |
112 |auto |386/486 |3 |386, 80386|Set automatically for 386 or 486 |
113 |auto |386 |INBOARD|None |386 with Intel Inboard |
114 |req'd |Fujitsu FMR-70 |5 |None |Must be set for Fujitsu FMR-70 |
115 |auto |386/486 w/ VCPI|11 |None |Set automatically if VCPI detected |
116 |req'd |Hitachi B32 |14 |None |Must be set for Hitachi B32 |
117 |req'd |OKI if800 |15 |None |Must be set for OKI if800 |
118 |option |IBM PS/55 |16 |None |May be needed for some PS/55s |
119 +-------+---------------+-------+----------+-----------------------------------+
120
121 The following procedure shows you how to test the switch mode setting.
122
123 1. If you have one of the machines listed below, set the DOS16M
124 environment variable to the value shown for that machine and specify a
125 range of extended memory. For example, if your machine is an NEC
126 98-series, set DOS16M=1 @2M-4M. See the section, "Fine Control of
127 Memory Usage" later in this chapter for more information about setting
128 the memory range.
129
130 +--------------------+---------+
131 | Machine | Setting |
132 +--------------------+---------+
133 | NEC 98-series | 1 |
134 | Fujitsu FMR-60,-70 | 5 |
135 | Hitachi B32 | 14 |
136 | OKI if800 | 15 |
137 +--------------------+---------+
138
139 Before running DOS/4GW applications, check the switch mode setting by
140 following this procedure:
141
142 2. Run PMINFO and note the switch setting reported on the last line of
143 the display. (PMINFO, which reports on the protected-mode resources
144 available to your programs, is described in more detail in the
145 chapter, "Utilities".)
146
147 If PMINFO runs, the setting is usable on your machine.
148
149 3. If you changed the switch setting, add the new setting to your
150 AUTOEXEC.BAT file.
151
152 Note: PMINFO will run successfully on 286 machines. If your DOS/4GW
153 application does not run, and PMINFO does, check the CPU type reported on
154 the first line of the display.
155
156 2 Changing the Switch Mode Setting Configuring DOS/4GW
157 -------------------------------------------------------------------------------
158
159 You are authorized (and encouraged) to distribute PMINFO to your
160 customers. You may also include a copy of this section in your
161 documentation.
162
163 1.3 Fine Control of Memory Usage
164
165 In addition to setting the switch mode as described above, the DOS16M
166 environment variable enables you to specify which portion of extended
167 memory DOS/4GW will use. The variable also allows you to instruct DOS/4GW
168 to search for extra memory and use it if it is present.
169
170 1.3.1 Specifying a Range of Extended Memory
171
172 Normally, you don't need to specify a range of memory with the DOS16M
173 variable. You must use the variable, however, in the following cases:
174
175 * You are running on a Fujitsu FMR-series, NEC 98-series, OKI
176 if800-series or Hitachi B-series machine.
177
178 * You have older programs that use extended memory but don't follow one
179 of the standard disciplines.
180
181 * You want to shell out of DOS/4GW to use another program that requires
182 extended memory.
183
184 If none of these conditions applies to you, you can skip this section.
185
186 The general syntax is:
187
188 set DOS16M= [switch_mode] [@start_address [- end_address]] [:size]
189
190 In the syntax shown above, start_address, end_address and size represent
191 numbers, expressed in decimal or in hexadecimal (hex requires a 0x
192 prefix). The number may end with a K to indicate an address or size in
193 kilobytes, or an M to indicate megabytes. If no suffix is given, the
194 address or size is assumed to be in kilobytes. If both a size and a range
195 are specified, the more restrictive interpretation is used.
196
197 The most flexible strategy is to specify only a size. However, if you are
198 running with other software that does not follow a convention for
199 indicating its use of extended memory, and these other programs start
200 before DOS/4GW, you will need to calculate the range of memory used by the
201 other programs and specify a range for DOS/4GW programs to use.
202
203 DOS/4GW ignores specifications (or parts of specifications) that conflict
204 with other information about extended memory use. Below are some examples
205 of memory usage control:
206
207
208
209
210 Fine Control of Memory Usage 3 Chapter 1
211 -------------------------------------------------------------------------------
212
213 set DOS16M= 1 @2m-4m Mode 1, for NEC 98-series machines, and use
214 extended memory between 2.0 and 4.0MB.
215
216 set DOS16M= :1M Use the last full megabyte of extended memory, or
217 as much as available limited to 1MB.
218
219 set DOS16M= @2m Use any extended memory available above 2MB.
220
221 set DOS16M= @ 0 - 5m Use any available extended memory from 0.0 (really
222 1.0) to 5.0MB.
223
224 set DOS16M= :0 Use no extended memory.
225
226 As a default condition DOS/4GW applications take all extended memory that
227 is not otherwise in use. Multiple DOS/4GW programs that execute
228 simultaneously will share the reserved range of extended memory. Any
229 non-DOS/4GW programs started while DOS/4GW programs are executing will
230 find that extended memory above the start of the DOS/4GW range is
231 unavailable, so they may not be able to run. This is very safe. There
232 will be a conflict only if the other program does not check the BIOS
233 configuration call (Interrupt 15H function 88H, get extended memory size).
234
235 To create a private pool of extended memory for your DOS/4GW application,
236 use the PRIVATXM program, described in the chapter, "Utilities".
237
238 The default memory allocation strategy is to use extended memory if
239 available, and overflow into DOS (low) memory.
240
241 In a VCPI or DPMI environment, the start_address and end_address arguments
242 are not meaningful. DOS/4GW memory under these protocols is not allocated
243 according to specific addresses because VCPI and DPMI automatically
244 prevent address conflicts between extended memory programs. You can
245 specify a size for memory managed by VCPI or DPMI, but DOS/4GW will not
246 necessarily allocate this memory from the highest available extended
247 memory address, as it does for memory managed under other protocols.
248
249 1.3.2 Using Extra Memory
250
251 Some machines contain extra non-extended, non-conventional memory just
252 below 16MB. When DOS/4GW runs on a Compaq 386, it automatically uses this
253 memory because the memory is allocated according to a certain protocol,
254 which DOS/4GW follows. Other machines have no protocol for allocating
255 this memory. To use the extra memory that may exist on these machines,
256 set DOS16M with the + option.
257
258 set DOS16M=+
259
260 Setting the + option causes DOS/4GW to search for memory in the range from
261 FA0000 to FFFFFF and determine whether the memory is usable. DOS/4GW does
262 this by writing into the extra memory and reading what it has written. In
263
264 4 Fine Control of Memory Usage Configuring DOS/4GW
265 -------------------------------------------------------------------------------
266
267 some cases, this memory is mapped for DOS or BIOS usage, or for other
268 system uses. If DOS/4GW finds extra memory that is mapped this way, and
269 is not marked read-only, it will write into that memory. This will cause
270 a crash, but won't have any other effect on your system.
271
272 1.4 Setting Runtime Options
273
274 The DOS16M environment variable sets certain runtime options for all
275 DOS/4GW programs running on the same system.
276
277 To set the environment variable, the syntax is:
278
279 set DOS16M=[switch_mode_setting]^options.
280
281 Note: Some command line editing TSRs, such as CED, use the caret (^) as a
282 delimiter. If you want to set DOS16M using the syntax above while one of
283 these TSRs is resident, modify the TSR to use a different delimiter.
284
285 These are the options:
286
287 0x01 check A20 line -- This option forces DOS/4GW to wait until the
288 A20 line is enabled before switching to protected mode. When
289 DOS/4GW switches to real mode, this option suspends your
290 program's execution until the A20 line is disabled, unless an
291 XMS manager (such as HIMEM.SYS) is active. If an XMS manager
292 is running, your program's execution is suspended until the A20
293 line is restored to the state it had when the CPU was last in
294 real mode. Specify this option if you have a machine that runs
295 DOS/4GW but is not truly AT-compatible. For more information
296 on the A20 line, see the section, "Controlling Address Line
297 A20" in this chapter.
298
299 0x02 prevent initialization of VCPI -- By default, DOS/4GW searches
300 for a VCPI server and, if one is present, forces it on. This
301 option is useful if your application does not use EMS
302 explicitly, is not a resident program, and may be used with
303 386-based EMS simulator software.
304
305 0x04 directly pass down keyboard status calls -- When this option is
306 set, status requests are passed down immediately and
307 unconditionally. When disabled, pass-downs are limited so the
308 8042 auxiliary processor does not become overloaded by keyboard
309 polling loops.
310
311 0x10 restore only changed interrupts -- Normally, when a DOS/4GW
312 program terminates, all interrupts are restored to the values
313 they had at the time of program startup. When you use this
314 option, only the interrupts changed by the DOS/4GW program are
315 restored.
316
317
318 Setting Runtime Options 5 Chapter 1
319 -------------------------------------------------------------------------------
320
321 0x20 set new memory to 00 -- When DOS/4GW allocates a new segment or
322 increases the size of a segment, the memory is zeroed. This
323 can help you find bugs having to do with uninitialized memory.
324 You can also use it to provide a consistent working environment
325 regardless of what programs were run earlier. This option only
326 affects segment allocations or expansions that are made through
327 the DOS/4GW kernel (with DOS function 48H or 4AH). This option
328 does not affect memory allocated with a compiler's malloc
329 function.
330
331 0x40 set new memory to FF -- When DOS/4GW allocates a new segment or
332 increases the size of a segment, the memory is set to 0xFF
333 bytes. This is helpful in making reproducible cases of bugs
334 caused by using uninitialized memory. This option only affects
335 segment allocations or expansions that are made through the
336 DOS/4GW kernel (with DOS function 48H or 4AH). This option
337 does not affect memory allocated with a compiler's malloc
338 function.
339
340 0x80 new selector rotation -- When DOS/4GW allocates a new selector,
341 it usually looks for the first available (unused) selector in
342 numerical order starting with the highest selector used when
343 the program was loaded. When this option is set, the new
344 selector search begins after the last selector that was
345 allocated. This causes new selectors to rotate through the
346 range. Use this option to find references to stale selectors,
347 i.e., segments that have been cancelled or freed.
348
349 1.5 Controlling Address Line 20
350
351 This section explains how DOS/4GW uses address line 20 (A20) and describes
352 the related DOS16M environment variable settings. It is unlikely that you
353 will need to use these settings.
354
355 Because the 8086 and 8088 chips have a 20-bit address spaces, their
356 highest addressable memory location is one byte below 1MB. If you specify
357 an address at 1MB or over, which would require a twenty-first bit to set,
358 the address wraps back to zero. Some parts of DOS depend on this wrap, so
359 on the 286 and 386, the twenty-first address bit is disabled. To address
360 extended memory, DOS/4GW enables the twenty-first address bit (the A20
361 line). The A20 line must be enabled for the CPU to run in protected mode,
362 but it may be either enabled or disabled in real mode.
363
364 By default, when DOS/4GW returns to real mode, it disables the A20 line.
365 Some software depends on the line being enabled. DOS/4GW recognizes the
366 most common software in this class, the XMS managers (such as HIMEM.SYS),
367 and enables the A20 line when it returns to real mode if an XMS manager is
368 present. For other software that requires the A20 line to be enabled, use
369 the A20 option. The A20 option makes DOS/4GW restore the A20 line to the
370
371
372 6 Controlling Address Line 20 Configuring DOS/4GW
373 -------------------------------------------------------------------------------
374
375 setting it had when DOS/4GW switched to protected mode. Set the
376 environment variable as follows:
377
378 set DOS16M= A20
379
380 To specify more than one option on the command line, separate the options
381 with spaces.
382
383 The DOS16M variable also lets you to specify the length of the delay
384 between a DOS/4GW instruction to change the status of the A20 line and the
385 next DOS/4GW operation. By default, this delay is 1 loop instruction when
386 DOS/4GW is running on a 386 machine. In some cases, you may need to
387 specify a longer delay for a machine that will run DOS/4GW but is not
388 truly AT-compatible. To change the delay, set DOS16M to the desired
389 number of loop instructions, preceded by a comma:
390
391 set DOS16M=,loops
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426 Controlling Address Line 20 7 Chapter 1
427 -------------------------------------------------------------------------------
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480 8 Controlling Address Line 20
481
482
483 2 VMM
484
485
486 The Virtual Memory Manager (VMM) uses a swap file on disk to augment RAM.
487 With VMM you can use more memory than your machine actually has. When RAM
488 is not sufficient, part of your program is swapped out to the disk file
489 until it is needed again. The combination of the swap file and available
490 RAM is the virtual memory.
491
492 Your program can use VMM if you set the DOS environment variable, DOS4GVM,
493 as follows. To set the DOS4GVM environment variable, use the format shown
494 below.
495
496 set DOS4GVM= [option[#value]] [option[#value]]
497
498 A "#" is used with options that take values since the DOS command shell
499 will not accept "=".
500
501 If you set DOS4GVM equal to 1, the default parameters are used for all
502 options.
503
504 Example:
505 C>set DOS4GVM=1
506
507 2.1 VMM Default Parameters
508
509 VMM parameters control the options listed below.
510
511 MINMEM The minimum amount of RAM managed by VMM. The default is
512 512KB.
513
514 MAXMEM The maximum amount of RAM managed by VMM. The default is 4MB.
515
516 SWAPMIN The minimum or initial size of the swap file. If this option
517 is not used, the size of the swap file is based on VIRTUALSIZE
518 (see below).
519
520 SWAPINC The size by which the swap file grows.
521
522 SWAPNAME The swap file name. The default name is "DOS4GVM.SWP". By
523 default the file is in the root directory of the current
524 drive. Specify the complete path name if you want to keep the
525 swap file somewhere else.
526
527 DELETESWAP Whether the swap file is deleted when your program exits. By
528 default the file is not deleted. Program startup is quicker
529 if the file is not deleted.
530
531 VIRTUALSIZE The size of the virtual memory space. The default is 16MB.
532
533
534 VMM Default Parameters 9 Chapter 2
535 -------------------------------------------------------------------------------
536
537 2.2 Changing the Defaults
538
539 You can change the defaults in two ways.
540
541 1. Specify different parameter values as arguments to the DOS4GVM
542 environment variable, as shown in the example below.
543
544 set DOS4GVM=deleteswap maxmem#8192
545
546 2. Create a configuration file with the filetype extension ".VMC", and
547 call that as an argument to the DOS4GVM environment variable, as shown
548 below.
549
550 set [email protected]
551
552 2.2.1 The .VMC File
553
554 A ".VMC" file contains VMM parameters and settings as shown in the example
555 below. Comments are permitted. Comments on lines by themselves are
556 preceded by an exclamation point (!). Comments that follow option
557 settings are preceded by white space. Do not insert blank lines:
558 processing stops at the first blank line.
559
560 !Sample .VMC file
561 !This file shows the default parameter values.
562 minmem = 512 At least 512K bytes of RAM is required.
563 maxmem = 4096 Uses no more than 4MB of RAM
564 virtualsize = 16384 Swap file plus allocated memory is 16MB
565 !To delete the swap file automatically when the program exits, add
566 !deleteswap
567 !To store the swap file in a directory called SWAPFILE, add
568 !swapname = c:\swapfile\dos4gvm.swp
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588 10 Changing the Defaults