dos4gw.doc

来自「开放源码的编译器open watcom 1.6.0版的源代码」· DOC 代码 · 共 541 行 · 第 1/2 页

DOC
541
字号

     0x20       set new memory to 00 -- When DOS/4GW allocates a new segment or
                increases the size of a segment, the memory is zeroed.  This
                can help you find bugs having to do with uninitialized memory.
                You can also use it to provide a consistent working environment
                regardless of what programs were run earlier.  This option only
                affects segment allocations or expansions that are made through
                the DOS/4GW kernel (with DOS function 48H or 4AH).  This option
                does not affect memory allocated with a compiler's malloc
                function.

     0x40       set new memory to FF -- When DOS/4GW allocates a new segment or
                increases the size of a segment, the memory is set to 0xFF
                bytes.  This is helpful in making reproducible cases of bugs
                caused by using uninitialized memory.  This option only affects
                segment allocations or expansions that are made through the
                DOS/4GW kernel (with DOS function 48H or 4AH).  This option
                does not affect memory allocated with a compiler's malloc
                function.

     0x80       new selector rotation -- When DOS/4GW allocates a new selector,
                it usually looks for the first available (unused) selector in
                numerical order starting with the highest selector used when
                the program was loaded.  When this option is set, the new
                selector search begins after the last selector that was
                allocated.  This causes new selectors to rotate through the
                range.  Use this option to find references to stale selectors,
                i.e., segments that have been cancelled or freed.

1.5 Controlling Address Line 20

     This section explains how DOS/4GW uses address line 20 (A20) and describes
     the related DOS16M environment variable settings.  It is unlikely that you
     will need to use these settings.

     Because the 8086 and 8088 chips have a 20-bit address spaces, their
     highest addressable memory location is one byte below 1MB.  If you specify
     an address at 1MB or over, which would require a twenty-first bit to set,
     the address wraps back to zero.  Some parts of DOS depend on this wrap, so
     on the 286 and 386, the twenty-first address bit is disabled.  To address
     extended memory, DOS/4GW enables the twenty-first address bit (the A20
     line).  The A20 line must be enabled for the CPU to run in protected mode,
     but it may be either enabled or disabled in real mode.

     By default, when DOS/4GW returns to real mode, it disables the A20 line.
     Some software depends on the line being enabled.  DOS/4GW recognizes the
     most common software in this class, the XMS managers (such as HIMEM.SYS),
     and enables the A20 line when it returns to real mode if an XMS manager is
     present.  For other software that requires the A20 line to be enabled, use
     the A20 option.  The A20 option makes DOS/4GW restore the A20 line to the


6   Controlling Address Line 20                                                            Configuring DOS/4GW
-------------------------------------------------------------------------------

     setting it had when DOS/4GW switched to protected mode.  Set the
     environment variable as follows:

       set DOS16M= A20

     To specify more than one option on the command line, separate the options
     with spaces.

     The DOS16M variable also lets you to specify the length of the delay
     between a DOS/4GW instruction to change the status of the A20 line and the
     next DOS/4GW operation.  By default, this delay is 1 loop instruction when
     DOS/4GW is running on a 386 machine.  In some cases, you may need to
     specify a longer delay for a machine that will run DOS/4GW but is not
     truly AT-compatible.  To change the delay, set DOS16M to the desired
     number of loop instructions, preceded by a comma:

       set DOS16M=,loops


































                                                Controlling Address Line 20   7Chapter 1
-------------------------------------------------------------------------------




















































8   Controlling Address Line 20


2 VMM


     The Virtual Memory Manager (VMM) uses a swap file on disk to augment RAM.
     With VMM you can use more memory than your machine actually has.  When RAM
     is not sufficient, part of your program is swapped out to the disk file
     until it is needed again.  The combination of the swap file and available
     RAM is the virtual memory.

     Your program can use VMM if you set the DOS environment variable, DOS4GVM,
     as follows.  To set the DOS4GVM environment variable, use the format shown
     below.

       set DOS4GVM= [option[#value]] [option[#value]]

     A "#" is used with options that take values since the DOS command shell
     will not accept "=".

     If you set DOS4GVM equal to 1, the default parameters are used for all
     options.

     Example:
       C>set DOS4GVM=1

2.1 VMM Default Parameters

     VMM parameters control the options listed below.

     MINMEM      The minimum amount of RAM managed by VMM.  The default is
                 512KB.

     MAXMEM      The maximum amount of RAM managed by VMM.  The default is 4MB.

     SWAPMIN     The minimum or initial size of the swap file.  If this option
                 is not used, the size of the swap file is based on VIRTUALSIZE
                 (see below).

     SWAPINC     The size by which the swap file grows.

     SWAPNAME    The swap file name.  The default name is "DOS4GVM.SWP".  By
                 default the file is in the root directory of the current
                 drive.  Specify the complete path name if you want to keep the
                 swap file somewhere else.

     DELETESWAP  Whether the swap file is deleted when your program exits.  By
                 default the file is not deleted.  Program startup is quicker
                 if the file is not deleted.

     VIRTUALSIZE The size of the virtual memory space.  The default is 16MB.


                                                     VMM Default Parameters   9Chapter 2
-------------------------------------------------------------------------------

2.2 Changing the Defaults

     You can change the defaults in two ways.

       1. Specify different parameter values as arguments to the DOS4GVM
         environment variable, as shown in the example below.

           set DOS4GVM=deleteswap maxmem#8192

       2. Create a configuration file with the filetype extension ".VMC", and
         call that as an argument to the DOS4GVM environment variable, as shown
         below.

           set DOS4GVM=@NEW4G.VMC

2.2.1 The .VMC File

     A ".VMC" file contains VMM parameters and settings as shown in the example
     below.  Comments are permitted.  Comments on lines by themselves are
     preceded by an exclamation point (!).  Comments that follow option
     settings are preceded by white space.  Do not insert blank lines:
     processing stops at the first blank line.

       !Sample .VMC file
       !This file shows the default parameter values.
       minmem = 512            At least 512K bytes of RAM is required.
       maxmem = 4096           Uses no more than 4MB of RAM
       virtualsize = 16384     Swap file plus allocated memory is 16MB
       !To delete the swap file automatically when the program exits, add
       !deleteswap
       !To store the swap file in a directory called SWAPFILE, add
       !swapname = c:\swapfile\dos4gvm.swp



















10  Changing the Defaults

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?