home *** CD-ROM | disk | FTP | other *** search
/ Freelog 38 / Freelog038.iso / Graphisme3D / Pov / Dos / povmsdos.exe / POVMSDOS.ZIP / USER_WAT.DOC < prev    next >
Text File  |  1998-07-22  |  36KB  |  732 lines

  1.                    PERSISTENCE OF VISION RAY TRACER(tm)
  2.  
  3.                           POV-Ray(tm) VERSION 3.1
  4.  
  5.       USER DOCUMENTATION FOR POV-Ray FOR MS-DOS USING WATCOM VERSION
  6.  
  7.  
  8. This file contains the documentation that is specific to the Watcom 
  9. compiled MS-Dos version of POV-Ray.  This contains technical info about 
  10. memory usage, how to configure the memory manager and other info that is 
  11. specific to the compiler that was used to create the program.  It is not 
  12. the full documentation for the program.  
  13.  
  14. Other documentation you will need is:
  15.  
  16.   POVMSDOS.DOC  This contains information about all MS-Dos versions of 
  17.                 POV-Ray.  It discucess command-line switches, display
  18.                 settings, and other dos-related topics.
  19.   POVUSER.TXT   This is a plain ASCII text file containing the full 
  20.                 tutorial and reference guide for POV-Ray.  It covers all
  21.                 features in detail.
  22.  
  23. NOTE: The MS-Dos version of POV-Ray no longer contains the hypertext help
  24. program POVHELP.EXE.  It was too difficult to maintain documentation in
  25. that format.  We realize that ASCII text is not a good substitute. However
  26. most MS-Dos users also have Windows 3.x or Windows 95/98/NT available. If
  27. you have Windows 95/98/NT then you should obtain the Windows version of 
  28. POV-Ray.  It has POVUSER.HLP which contains the same information as 
  29. POVUSER.TXT in nicely formatted hypertext help form with illustrations.
  30. If you don't want to use POV-Ray for Windows 95/98/NT or only have 
  31. Windows 3.x then check out POVUSER.PDF in Adobe Acrobat PDF format. The
  32. Acrobat Reader is available for free at http://www.adobe.com and runs
  33. on Windows, Mac, & Unix.  Finally POVHTML.ZIP is an archive containing
  34. the povuser information in html format for viewing with an internet 
  35. browser.
  36.  
  37.  
  38. 1.0   Introduction
  39.  
  40. The Watcom compiled version of POV-Ray is designated by either
  41. ".msdos.wat-cwa" or ".msdos.wat-d4g" after the POV-Ray version number on 
  42. the opening banner.  Everything in this document ONLY applies to that 
  43. version.  Other versions will operate under different rules.  This file is 
  44. NOT the only documentation for POV-Ray.  There is a file called 
  45. POVMSDOS.DOC which covers the MSDOS-specific features but that still isn't 
  46. everything.  There is a hypertext utility POVHELP.EXE that reads a file
  47. POVHELP.PHE which contains the main documentation for POV-Ray itself that 
  48. is common to all versions.  
  49.  
  50. This version has been compiled as a 32-bit DOS protected mode application.  
  51. It must be run on a 386 or higher system with at least 4 meg of memory.  
  52. More memory is preferred.
  53.  
  54. The program uses one of two different DOS extenders to manage memory and
  55. to create and use virtual memory swap files.  The "wat-cwa" version
  56. uses the CauseWay DOS extender written by Michael Devore & John Wildsmith.
  57. It is linked directly into the official POV-Ray executible.  If you
  58. are using an official version, this is the extender you will use.
  59.  
  60. Although the CauseWay authors have graciously donated a copy to the
  61. POV-Team, CauseWay is still very much a commercial product.  We cannot 
  62. include it with the free source code for POV-Ray for you compile-it-yourself 
  63. people.  You will have to purchase it directly from the authors.
  64.  
  65. Alternatly, another DOS extender called DOS4GW is supplied with the
  66. Watcom compiler.  However it is limited to a total of 32meg of memory.
  67. If your version is designated "wat-d4g" it uses the DOS4GW extender.
  68. The instructions below explain how CauseWay and DOS4GW use memory.  Do
  69. not try to use CauseWay variables with DOS4GW or vice-versa.
  70.  
  71. Be sure to read POVMSDOS.DOC and run POVHELP to make sure you have all the 
  72. remaining documentation.  This file only applies to the Watcom compiled 
  73. version.  Also read POVWHERE.GET for more information on POV-Ray archives 
  74. and support information.
  75.  
  76. ---------------------------------------------------------------------------
  77.                     CAUSEWAY DOS EXTENDER CONFIGURATION
  78.  
  79. Excerpted from Chapter 1 of the CauseWay DOS Extender User's Manual.  
  80. It is (c) Copyright 1992-1996 by Michael Devore.
  81. Used by permission.
  82.  
  83. Postal:         Devore Software & Consulting
  84.                 PO Box 4283
  85.                 Naperville, IL  60567-4283
  86.                 USA
  87. CompuServe:     71540,62
  88. Internet:       71540.62@compuserve.com
  89. Telephone:      1-708-717-6369
  90. Fax:            1-708-717-6373
  91. BBS:            1-708-717-9679
  92.  
  93. Note: The 708 area code changes to 630 in August of 1996.
  94.  
  95.  
  96. INTRODUCTION
  97.  
  98. What is CauseWay for Watcom C++ and Assembly Language?
  99. CauseWay is a 386 DOS extender package for use with Watcom C++ and
  100. assembly language programs. It consists of a DOS extender, provided as
  101. a stub EXE for Watcom C++ applications.
  102.  
  103. Within the standard DOS, and Windows and OS/2 DOS box
  104. environments, CauseWay supports very large memory models for
  105. applications on PC compatibles with an 80386SX processor or above
  106. without the need to use overlays or crude stopgap measures such as
  107. EMS/XMS swapping. To do this, the DOS extender runs applications in
  108. protected mode, rather than the real mode normally used in the DOS
  109. environments. CauseWay supports both 16-bit and 32-bit protected mode
  110. applications operating under a DOS environment.  It makes full use of
  111. 386-level chip capabilities including demand paging of code and data,
  112. variable-sized segments up to 4G in length, mixing 16- and 32-bit
  113. segments as well as support for flat (non-segmented) memory addressing
  114. models. The CauseWay implementation of these powerful capabilities
  115. provides all their benefits while being transparent to the application user.
  116.  
  117. Applications created using CauseWay are compatible with the VCPI and
  118. DPMI standards and run equally well on systems with no protected mode
  119. drivers or programs. CauseWay applications work with such diverse
  120. environments as normal DOS, DesqView, Windows 3.0 and above in
  121. both standard and enhanced modes, as well as DOS windows within OS/2
  122. 2.0 and above. CauseWay allocates memory from DPMI, VCPI, XMS,
  123. and INT 15H services, in addition to conventional DOS memory. This
  124. allows CauseWay applications to allocate memory through the CauseWay
  125. DOS extender without the need to detect or manipulate the various
  126. memory handling schemes.
  127.  
  128. MINIMUM SYSTEM REQUIREMENTS
  129.  
  130. CauseWay for Watcom C++ and Assembly Language requires a 386SX
  131. based computer or better. The required operating environment is MS-
  132. DOS or PC-DOS 3.1 or higher, Windows 3.0 or higher, OS/2 2.0 and
  133. above, or compatible operating system that provides a DPMI or VCPI
  134. DOS environment. 
  135.  
  136. DOS 3.3+ and a 386 machine or better are necessary to run CauseWay
  137. applications.
  138.  
  139. CAUSEWAY MEMORY REQUIREMENTS
  140.  
  141. The recommended minimum amount of total free physical memory for
  142. CauseWay applications is 500K total. 100-150K of this memory must be
  143. conventional DOS memory, the remainder may be extended memory.
  144. CauseWay applications can run in less memory, down to the 300K range,
  145. provided sufficient virtual (disk-based) memory is available, but
  146. application performance will decline significantly. More physical
  147. memory improves a program's performance, reducing virtual memory
  148. disk access overhead.
  149.  
  150. When running the DOS-extended application, DOS first loads the
  151. CauseWay DOS extender in conventional memory. CauseWay
  152. establishes the protected mode environment, retrieves the application from
  153. the executable file - loading it first into extended memory, then
  154. conventional memory if extended is exhausted, then virtual (disk-based)
  155. memory if conventional is exhausted - sets up the application for
  156. execution, and finally passes control to the application to begin operation.
  157.  
  158. No additional files are required to make your application run in 386
  159. protected mode using the CauseWay DOS extender.
  160.  
  161. OPERATIONAL CONSIDERATIONS WHEN USING CAUSEWAY
  162.  
  163. The TEMP, TMP, and CAUSEWAY=SWAP environment variables are
  164. used by CauseWay to determine where to build its virtual memory swap
  165. file when an application is not operating under Windows or OS/2
  166. (Windows and OS/2 use their own virtual memory files). Since
  167. CauseWay has integrated virtual memory, disk space is considered part of
  168. total memory. If you use the TEMP, TMP, or SWAP environment
  169. variable to point to a small RAM disk or almost full disk, free memory
  170. will be affected accordingly. If virtual (disk-based) memory is less than
  171. physical (installed on machine) memory, Cause Way turns off virtual
  172. memory. On the other hand, if you have a disk 300M free, CauseWay
  173. will have no problem reporting 300M free memory to your program,
  174. provided that virtual memory is not inhibited or limited by the
  175. CAUSEWAY environment variable memory settings.
  176.  
  177. Memory operates differently under Windows and OS/2. With OS/2, the
  178. DPMI setting for the session determines available memory. With
  179. Windows, available memory is the total of physical memory plus the
  180. swap file size less any memory already in use by Windows or another
  181. Windows application.
  182.  
  183. When creating a VMM swap file at application startup under DOS,
  184. CauseWay builds a list of possible paths in order of priority. CauseWay
  185. then works through the list until one of the entries provides both a valid
  186. drive and path specification and sufficient free space to begin operation.
  187. The first entry to succeed becomes the swap file drive with no further
  188. processing of the list. If CauseWay reaches the end of the list without
  189. finding a valid drive, it disables the virtual memory manager. The order
  190. of priority is: CAUSEWAY=SWAP, TEMP, TMP, and application
  191. execution path.
  192.  
  193. If endusers reboot the system or turn off power while executing a
  194. CauseWay application under DOS, a temporary file will be left on the
  195. system by CauseWay. This will usually be a zero length file unless the
  196. application was large enough to exceed physical memory and CauseWay
  197. had started using its virtual memory manager. The temporary file name
  198. is requested using standard DOS functions, meaning the name will vary
  199. with different versions of DOS. It typically is a mixture of letters and
  200. numbers with no extension, although a .$$$ extension may be presented
  201. when operating under a network. Make sure you do not delete this
  202. temporary file while the CauseWay application is still active, as improper
  203. or erratic program operation, including lockups, may occur.
  204.  
  205. Application startup times may increase significantly if free physical
  206. memory is less than the executable size. In such cases, not only must the
  207. executable be loaded into physical memory, but a virtual memory file of
  208. the executable file size must also be built. This file holds the portions of
  209. the executable that do not fit into physical memory and which have not
  210. been recently accessed. After startup is complete, the program will
  211. operate normally, paging to and from virtual memory as necessary.
  212.  
  213. CauseWay automatically sets aside 32K of low DOS memory for
  214. allocation and use by developer routines via the GetMemDOS API
  215. function. The 32K memory block is available even if CauseWay needs to
  216. use virtual memory just to load an application. The set-aside amount can
  217. be increased by using the CAUSEWAY environment variable LOWMEM
  218. option although the additional set-aside goal is not guaranteed to be
  219. reached if too little conventional memory is left for CauseWay's
  220. operating requirements.
  221.  
  222. ENVIRONMENT VARIABLES
  223.  
  224. CauseWay can make use of three environment variables at runtime:
  225. TEMP, TMP, and CAUSEWAY. 
  226.  
  227. TEMP and TMP Environment Variables
  228.  
  229. The TEMP and TMP environment variables specify the directory and
  230. drive where a swap file is built by CauseWay's virtual memory manager
  231. (VMM) when operating under DOS. Windows and OS/2 provide their
  232. own memory management functions which override CauseWay's use of
  233. the TEMP and TMP environment variables. The path indicated by
  234. TEMP will be used under DOS if both TEMP and TMP environment
  235. variables exist. Both settings are superseded by the
  236. CAUSEWAY=SWAP environment variable setting.
  237.  
  238. SET TMP=C:\SWAP
  239.  
  240. The example above directs the CauseWay DOS extender to create its
  241. swap file, if any, in the C:\SWAP directory. 
  242.  
  243. If no TEMP, TMP and CAUSEWAY=SWAP settings are present or are
  244. invalid, the current drive is used when creating a swap file. If free drive
  245. space is less than physical memory (extended and conventional) available
  246. at startup, then the DOS extender VMM is disabled, no swap file is
  247. created, and virtual memory is not available to the application.
  248.  
  249. CAUSEWAY Environment Variable
  250.  
  251. The CAUSEWAY environment variable controls operation of the DOS
  252. extender at application runtime. Seven options are supported, although
  253. they are ignored in a Window or OS/2 DPMI environment. Use any
  254. combination of the seven options in the following format:
  255.  
  256. SET CAUSEWAY=[setting_1;] [setting 2;] [setting_n;]
  257.  
  258. Items in brackets ([ ]) are optional. Do not actually type the brackets if
  259. you use the optional items. Items in italics should be replaced with actual
  260. values, separated by semicolons. Following is a description of the seven 
  261. valid settings:
  262.  
  263. DPMI          Force DPMI rather than default VCPI usage whenever    
  264.               possible (recommended for 386^Max and BlueMax         
  265.               users). The memory manager must support DPMI or       
  266.               else this setting is ignored.                         
  267.              
  268. EXTALL        Force CauseWay to use all extended memory and sub-     
  269.               allocate memory from the bottom up instead of the      
  270.               default top-down approach. This setting is most useful 
  271.               for processor intensive enviromnents which have a      
  272.               small hardware CPU cache. Use of this setting means    
  273.               that no extended memory will be available for other    
  274.               programs while the application is loaded (including    
  275.               shelling to DOS).                                      
  276.  
  277. HIMEM:nnn     Set maximum physical (conventional plus extended)     
  278.               memory that can be consumed by CauseWay. "nnn" is       
  279.               the decimal number of kilobytes that can be consumed. 
  280.               If memory allocation requests exceed this figure,     
  281.               CauseWay will use virtual memory, even if additional  
  282.               physical memory is present. If the HIMEM memory       
  283.               value exceeds available physical memory, then memory  
  284.               allocations operate normally. For example,            
  285.               HIMEM:2048 on a 4M machine would force virtual        
  286.               memory use after 2M of memory allocations (including  
  287.               loading the executable file). The remaining 2M of     
  288.               memory could be used by other applications while the  
  289.               CauseWay application is active.                       
  290.  
  291. LOWMEM:nnn    Set DOS (conventional) memory to restrict it from use  
  292.               by CauseWay. This memory is in addition to the           
  293.               default 32K low DOS memory block reserved by             
  294.               CauseWay for use by any applications which need to       
  295.               allocate DOS memory. nnn is the decimal number of        
  296.               kilobytes to reserve. If there is not enough             
  297.               conventional memory to satisfy the nnn request value     
  298.               then CauseWay will leave all conventional memory         
  299.               free that is not required by the extender to operate.    
  300.               Note that tnis option does not guarantee the amount of   
  301.               free DOS memory, just how much needs to be free          
  302.               before CauseWay will consume DOS memory after            
  303.               exhausting all extended memory. For example,             
  304.               LOWMEM:200 will attempt to reserve 200K of DOS           
  305.               memory, even if CauseWay has exhausted all extended      
  306.               memory and is using conventional memory to fill          
  307.               memory allocation requests.                              
  308.  
  309. MAXMEM:nnn    Set maximum linear address space provided by           
  310.               CauseWay. nnn is the decimal number of megabytes of    
  311.               linear address space. This setting is similar to HIMEM 
  312.               except that it includes any virtual memory. For        
  313.               example, MAXMEM:32 on a 16M memory system              
  314.               restricts VMM disk space usage to 32M, even if more    
  315.               disk space is present. MAXMEM:8 on the same            
  316.               system would restrict the application to 8M of memory  
  317.               (all physical). Note that the setting is in megabytes, 
  318.               rather than kilobytes used in the LOWMEM and           
  319.               HIMEM options.                                         
  320.  
  321. NOVM          Disable all virtual memory use by CauseWay. If  
  322.               physical memory is exhausted, CauseWay will fail
  323.               further memory allocation requests.             
  324.  
  325. SWAP:path     Set CauseWay's virtual memory manager swap file  
  326.               path. This path takes precedence for choosing the
  327.               location of a swap file over the TEMP and TMP    
  328.               environment variables.                           
  329.  
  330. ---------------------------------------------------------------------------
  331. This concludes the information on the CauseWay DOS Extender which is
  332. linked into the official POV-Ray executible.  The information below
  333. applies ONLY if you have compiled the program yourself using the Watcom
  334. compiler and the DOS4GW extender.
  335.  
  336. ---------------------------------------------------------------------------
  337. ---------------------------------------------------------------------------
  338.                      DOS/4GW Configuration Guide
  339.  
  340.                   WATCOM International Corporation
  341.  
  342.                       Waterloo, Ontario, Canada
  343.  
  344. This chapter explains how to use the DOS4G environment variable to
  345. suppress the banner that is displayed by DOS/4GW at startup.  It also
  346. explains how to use the DOS16M environment variable to select the switch
  347. mode setting, if necessary, and to specify the range of extended memory in
  348. which DOS/4GW will operate.  DOS/4GW is based on Rational Systems' DOS/16M
  349. 16-bit Protected-Mode support; hence the DOS16M environment variable name
  350. remains unchanged.
  351.  
  352. 1.1 Suppressing the DOS/4GW Banner
  353.  
  354. The banner that is displayed by DOS/4GW at startup can be suppressed by
  355. issuing the following command:
  356.  
  357.   set DOS4G=quiet
  358.  
  359. Do not insert a space between DOS4G and the equal sign.  A space to the
  360. right of the equal sign is optional.
  361.  
  362. 1.2 Changing the Switch Mode Setting
  363.  
  364. In almost all cases, DOS/4GW programs can detect the type of machine that
  365. is running and automatically choose an appropriate real- to protected-mode
  366. switch technique.  For the few cases in which this default setting does
  367. not work we provide the DOS16M DOS environment variable, which overrides
  368. the default setting.
  369.  
  370. Change the switch mode settings by issuing the following command:
  371.  
  372.   set DOS16M=value
  373.  
  374. Do not insert a space between DOS16M and the equal sign.  A space to the
  375. right of the equal sign is optional.
  376.  
  377. The table below lists the machines and the settings you would use with
  378. them.  Many settings have mnemonics, listed in the column "Alternate
  379. Name", that you can use instead of the number.  Settings that you must set
  380. with the DOS16M variable have the notation req'd in the first column.
  381. Settings you may use are marked option, and settings that will
  382. automatically be set are marked auto.
  383.  
  384. +------+---------------+-------+---------+-----------------------------------+
  385. |      |               |       |Alternate|                                   |
  386. |Status|Machine        |Setting|Name     |Comment                            |
  387. +------+---------------+-------+---------+-----------------------------------+
  388. |auto  |386/486 w/ DPMI|0      |None     |Set automatically if DPMI is active|
  389. |req'd |NEC 98-series  |1      |9801     |Must be set for NEC 98-series      |
  390. |auto  |PS/2           |2      |None     |Set automatically for PS/2         |
  391. |auto  |386/486        |3      |386,80386|Set automatically for 386 or 486   |
  392. |auto  |386            |INBOARD|None     |386 with Intel Inboard             |
  393. |req'd |Fujitsu FMR-70 |5      |None     |Must be set for Fujitsu FMR-70     |
  394. |auto  |386/486 w/ VCPI|11     |None     |Set automatically if VCPI detected |
  395. |req'd |Hitachi B32    |14     |None     |Must be set for Hitachi B32        |
  396. |req'd |OKI if800      |15     |None     |Must be set for OKI if800          |
  397. |option|IBM PS/55      |16     |None     |May be needed for some PS/55s      |
  398. +------+---------------+-------+---------+-----------------------------------+
  399.  
  400. The following procedure shows you how to test the switch mode setting.
  401.  
  402.   1. If you have one of the machines listed below, set the DOS16M
  403.     environment variable to the value shown for that machine and specify a
  404.     range of extended memory.  For example, if your machine is an NEC
  405.     98-series, set DOS16M=1 @2M-4M.  See the section, "Fine Control of
  406.     Memory Usage" later in this chapter for more information about setting
  407.     the memory range.
  408.  
  409.        +--------------------+---------+
  410.        | Machine            | Setting |
  411.        +--------------------+---------+
  412.        | NEC 98-series      | 1       |
  413.        | Fujitsu FMR-60,-70 | 5       |
  414.        | Hitachi B32        | 14      |
  415.        | OKI if800          | 15      |
  416.        +--------------------+---------+
  417.  
  418.     Before running DOS/4GW applications, check the switch mode setting by
  419.     following this procedure:
  420.  
  421.   2. Run PMINFO and note the switch setting reported on the last line of
  422.     the display.  (PMINFO, which reports on the protected-mode resources
  423.     available to your programs, is described in more detail in the
  424.     chapter, "Utilities".)
  425.  
  426.     If PMINFO runs, the setting is usable on your machine.
  427.  
  428.   3. If you changed the switch setting, add the new setting to your
  429.     AUTOEXEC.BAT file.
  430.  
  431. Note:  PMINFO will run successfully on 286 machines.  If your DOS/4GW
  432. application does not run, and PMINFO does, check the CPU type reported on
  433. the first line of the display.
  434.  
  435. You are authorized (and encouraged) to distribute PMINFO to your
  436. customers.  You may also include a copy of this section in your
  437. documentation.
  438.  
  439. 1.3 Fine Control of Memory Usage
  440.  
  441. In addition to setting the switch mode as described above, the DOS16M
  442. environment variable enables you to specify which portion of extended
  443. memory DOS/4GW will use.  The variable also allows you to instruct DOS/4GW
  444. to search for extra memory and use it if it is present.
  445.  
  446. 1.3.1 Specifying a Range of Extended Memory
  447.  
  448. Normally, you don't need to specify a range of memory with the DOS16M
  449. variable.  You must use the variable, however, in the following cases:
  450.  
  451.   * You are running on a Fujitsu FMR-series, NEC 98-series, OKI
  452.    if800-series or Hitachi B-series machine.
  453.  
  454.   * You have older programs that use extended memory but don't follow one
  455.    of the standard disciplines.
  456.  
  457.   * You want to shell out of DOS/4GW to use another program that requires
  458.    extended memory.
  459.  
  460. If none of these conditions applies to you, you can skip this section.
  461.  
  462. The general syntax is:
  463.  
  464.   set DOS16M= [switch_mode] [@start_address [- end_address]] [:size]
  465.  
  466. In the syntax shown above, start_address, end_address and size represent
  467. numbers, expressed in decimal or in hexadecimal (hex requires a 0x
  468. prefix).  The number may end with a K to indicate an address or size in
  469. kilobytes, or an M to indicate megabytes.  If no suffix is given, the
  470. address or size is assumed to be in kilobytes.  If both a size and a range
  471. are specified, the more restrictive interpretation is used.
  472.  
  473. The most flexible strategy is to specify only a size.  However, if you are
  474. running with other software that does not follow a convention for
  475. indicating its use of extended memory, and these other programs start
  476. before DOS/4GW, you will need to calculate the range of memory used by the
  477. other programs and specify a range for DOS/4GW programs to use.
  478.  
  479. DOS/4GW ignores specifications (or parts of specifications) that conflict
  480. with other information about extended memory use.  Below are some examples
  481. of memory usage control:
  482.  
  483. set DOS16M= 1 @2m-4m    Mode 1, for NEC 98-series machines, and use
  484.                         extended memory between 2.0 and 4.0MB.
  485.  
  486. set DOS16M= :1M         Use the last full megabyte of extended memory, or
  487.                         as much as available limited to 1MB.
  488.  
  489. set DOS16M= @2m         Use any extended memory available above 2MB.
  490.  
  491. set DOS16M= @ 0 - 5m    Use any available extended memory from 0.0 (really
  492.                         1.0) to 5.0MB.
  493.  
  494. set DOS16M= :0          Use no extended memory.
  495.  
  496. As a default condition DOS/4GW applications take all extended memory that
  497. is not otherwise in use.  Multiple DOS/4GW programs that execute
  498. simultaneously will share the reserved range of extended memory.  Any
  499. non-DOS/4GW programs started while DOS/4GW programs are executing will
  500. find that extended memory above the start of the DOS/4GW range is
  501. unavailable, so they may not be able to run.  This is very safe.  There
  502. will be a conflict only if the other program does not check the BIOS
  503. configuration call (Interrupt 15H function 88H, get extended memory size).
  504.  
  505. To create a private pool of extended memory for your DOS/4GW application,
  506. use the PRIVATXM program, described in the chapter, "Utilities".
  507.  
  508. The default memory allocation strategy is to use extended memory if
  509. available, and overflow into DOS (low) memory.
  510.  
  511. In a VCPI or DPMI environment, the start_address and end_address arguments
  512. are not meaningful.  DOS/4GW memory under these protocols is not allocated
  513. according to specific addresses because VCPI and DPMI automatically
  514. prevent address conflicts between extended memory programs.  You can
  515. specify a size for memory managed by VCPI or DPMI, but DOS/4GW will not
  516. necessarily allocate this memory from the highest available extended
  517. memory address, as it does for memory managed under other protocols.
  518.  
  519. 1.3.2 Using Extra Memory
  520.  
  521. Some machines contain extra non-extended, non-conventional memory just
  522. below 16MB.  When DOS/4GW runs on a Compaq 386, it automatically uses this
  523. memory because the memory is allocated according to a certain protocol,
  524. which DOS/4GW follows.  Other machines have no protocol for allocating
  525. this memory.  To use the extra memory that may exist on these machines,
  526. set DOS16M with the + option.
  527.  
  528.   set DOS16M=+
  529.  
  530. Setting the + option causes DOS/4GW to search for memory in the range from
  531. FA0000 to FFFFFF and determine whether the memory is usable.  DOS/4GW does
  532. this by writing into the extra memory and reading what it has written.  In
  533. some cases, this memory is mapped for DOS or BIOS usage, or for other
  534. system uses.  If DOS/4GW finds extra memory that is mapped this way, and
  535. is not marked read-only, it will write into that memory.  This will cause
  536. a crash, but won't have any other effect on your system.
  537.  
  538. 1.4 Setting Runtime Options
  539.  
  540. The DOS16M environment variable sets certain runtime options for all
  541. DOS/4GW programs running on the same system.
  542.  
  543. To set the environment variable, the syntax is:
  544.  
  545.   set DOS16M=[switch_mode_setting]^options.
  546.  
  547. Note:  Some command line editing TSRs, such as CED, use the caret (^) as a
  548. delimiter.  If you want to set DOS16M using the syntax above while one of
  549. these TSRs is resident, modify the TSR to use a different delimiter.
  550.  
  551. These are the options:
  552.  
  553. 0x01       check A20 line -- This option forces DOS/4GW to wait until the
  554.            A20 line is enabled before switching to protected mode.  When
  555.            DOS/4GW switches to real mode, this option suspends your
  556.            program's execution until the A20 line is disabled, unless an
  557.            XMS manager (such as HIMEM.SYS) is active.  If an XMS manager
  558.            is running, your program's execution is suspended until the A20
  559.            line is restored to the state it had when the CPU was last in
  560.            real mode.  Specify this option if you have a machine that runs
  561.            DOS/4GW but is not truly AT-compatible.  For more information
  562.            on the A20 line, see the section, "Controlling Address Line
  563.            A20" in this chapter.
  564.  
  565. 0x02       prevent initialization of VCPI -- By default, DOS/4GW searches
  566.            for a VCPI server and, if one is present, forces it on.  This
  567.            option is useful if your application does not use EMS
  568.            explicitly, is not a resident program, and may be used with
  569.            386-based EMS simulator software.
  570.  
  571. 0x04       directly pass down keyboard status calls -- When this option is
  572.            set, status requests are passed down immediately and
  573.            unconditionally.  When disabled, pass-downs are limited so the
  574.            8042 auxiliary processor does not become overloaded by keyboard
  575.            polling loops.
  576.  
  577. 0x10       restore only changed interrupts -- Normally, when a DOS/4GW
  578.            program terminates, all interrupts are restored to the values
  579.            they had at the time of program startup.  When you use this
  580.            option, only the interrupts changed by the DOS/4GW program are
  581.            restored.
  582.  
  583. 0x20       set new memory to 00 -- When DOS/4GW allocates a new segment or
  584.            increases the size of a segment, the memory is zeroed.  This
  585.            can help you find bugs having to do with uninitialized memory.
  586.            You can also use it to provide a consistent working environment
  587.            regardless of what programs were run earlier.  This option only
  588.            affects segment allocations or expansions that are made through
  589.            the DOS/4GW kernel (with DOS function 48H or 4AH).  This option
  590.            does not affect memory allocated with a compiler's malloc
  591.            function.
  592.  
  593. 0x40       set new memory to FF -- When DOS/4GW allocates a new segment or
  594.            increases the size of a segment, the memory is set to 0xFF
  595.            bytes.  This is helpful in making reproducible cases of bugs
  596.            caused by using uninitialized memory.  This option only affects
  597.            segment allocations or expansions that are made through the
  598.            DOS/4GW kernel (with DOS function 48H or 4AH).  This option
  599.            does not affect memory allocated with a compiler's malloc
  600.            function.
  601.  
  602. 0x80       new selector rotation -- When DOS/4GW allocates a new selector,
  603.            it usually looks for the first available (unused) selector in
  604.            numerical order starting with the highest selector used when
  605.            the program was loaded.  When this option is set, the new
  606.            selector search begins after the last selector that was
  607.            allocated.  This causes new selectors to rotate through the
  608.            range.  Use this option to find references to stale selectors,
  609.            i.e., segments that have been cancelled or freed.
  610.  
  611. 1.5 Controlling Address Line 20
  612.  
  613. This section explains how DOS/4GW uses address line 20 (A20) and describes
  614. the related DOS16M environment variable settings.  It is unlikely that you
  615. will need to use these settings.
  616.  
  617. Because the 8086 and 8088 chips have a 20-bit address spaces, their
  618. highest addressable memory location is one byte below 1MB.  If you specify
  619. an address at 1MB or over, which would require a twenty-first bit to set,
  620. the address wraps back to zero.  Some parts of DOS depend on this wrap, so
  621. on the 286 and 386, the twenty-first address bit is disabled.  To address
  622. extended memory, DOS/4GW enables the twenty-first address bit (the A20
  623. line).  The A20 line must be enabled for the CPU to run in protected mode,
  624. but it may be either enabled or disabled in real mode.
  625.  
  626. By default, when DOS/4GW returns to real mode, it disables the A20 line.
  627. Some software depends on the line being enabled.  DOS/4GW recognizes the
  628. most common software in this class, the XMS managers (such as HIMEM.SYS),
  629. and enables the A20 line when it returns to real mode if an XMS manager is
  630. present.  For other software that requires the A20 line to be enabled, use
  631. the A20 option.  The A20 option makes DOS/4GW restore the A20 line to the
  632. setting it had when DOS/4GW switched to protected mode.  Set the
  633. environment variable as follows:
  634.  
  635.   set DOS16M= A20
  636.  
  637. To specify more than one option on the command line, separate the options
  638. with spaces.
  639.  
  640. The DOS16M variable also lets you to specify the length of the delay
  641. between a DOS/4GW instruction to change the status of the A20 line and the
  642. next DOS/4GW operation.  By default, this delay is 1 loop instruction when
  643. DOS/4GW is running on a 386 machine.  In some cases, you may need to
  644. specify a longer delay for a machine that will run DOS/4GW but is not
  645. truly AT-compatible.  To change the delay, set DOS16M to the desired
  646. number of loop instructions, preceded by a comma:
  647.  
  648.   set DOS16M=,loops
  649.  
  650. 2.0  VMM
  651.  
  652. The Virtual Memory Manager (VMM) uses a swap file on disk to augment RAM.
  653. With VMM you can use more memory than your machine actually has.  When RAM
  654. is not sufficient, part of your program is swapped out to the disk file
  655. until it is needed again.  The combination of the swap file and available
  656. RAM is the virtual memory.
  657.  
  658. Your program can use VMM if you set the DOS environment variable, DOS4GVM,
  659. as follows.  To set the DOS4GVM environment variable, use the format shown
  660. below.
  661.  
  662.   set DOS4GVM= [option[#value]] [option[#value]]
  663.  
  664. A "#" is used with options that take values since the DOS command shell
  665. will not accept "=".
  666.  
  667. If you set DOS4GVM equal to 1, the default parameters are used for all
  668. options.
  669.  
  670. Example:
  671.   C>set DOS4GVM=1
  672.  
  673. 2.1 VMM Default Parameters
  674.  
  675. VMM parameters control the options listed below.
  676.  
  677. MINMEM      The minimum amount of RAM managed by VMM.  The default is
  678.             512KB.
  679.  
  680. MAXMEM      The maximum amount of RAM managed by VMM.  The default is 4MB.
  681.  
  682. SWAPMIN     The minimum or initial size of the swap file.  If this option
  683.             is not used, the size of the swap file is based on VIRTUALSIZE
  684.             (see below).
  685.  
  686. SWAPINC     The size by which the swap file grows.
  687.  
  688. SWAPNAME    The swap file name.  The default name is "DOS4GVM.SWP".  By
  689.             default the file is in the root directory of the current
  690.             drive.  Specify the complete path name if you want to keep the
  691.             swap file somewhere else.
  692.  
  693. DELETESWAP  Whether the swap file is deleted when your program exits.  By
  694.             default the file is not deleted.  Program startup is quicker
  695.             if the file is not deleted.
  696.  
  697. VIRTUALSIZE The size of the virtual memory space.  The default is 16MB.
  698.  
  699. 2.2 Changing the Defaults
  700.  
  701. You can change the defaults in two ways.
  702.  
  703.   1. Specify different parameter values as arguments to the DOS4GVM
  704.     environment variable, as shown in the example below.
  705.  
  706.       set DOS4GVM=deleteswap maxmem#8192
  707.  
  708.   2. Create a configuration file with the filetype extension ".VMC", and
  709.     call that as an argument to the DOS4GVM environment variable, as shown
  710.     below.
  711.  
  712.       set DOS4GVM=@NEW4G.VMC
  713.  
  714. 2.2.1 The .VMC File
  715.  
  716. A ".VMC" file contains VMM parameters and settings as shown in the example
  717. below.  Comments are permitted.  Comments on lines by themselves are
  718. preceded by an exclamation point (!).  Comments that follow option
  719. settings are preceded by white space.  Do not insert blank lines:
  720. processing stops at the first blank line.
  721.  
  722.   !Sample .VMC file
  723.   !This file shows the default parameter values.
  724.   minmem = 512            At least 512K bytes of RAM is required.
  725.   maxmem = 4096           Uses no more than 4MB of RAM
  726.   virtualsize = 16384     Swap file plus allocated memory is 16MB
  727.   !To delete the swap file automatically when the program exits, add
  728.   !deleteswap
  729.   !To store the swap file in a directory called SWAPFILE, add
  730.   !swapname = c:\swapfile\dos4gvm.swp
  731.  
  732.