  This document contains switches for Windows and Windows/386.
Some of these switches do not apply to retail Windows such as those
under the [KERNEL] section.  I left them all for information purposes.


Debugging switches for [KERNEL] section of WIN.INI

  * Explainations of these can be found in the Software Development Kit
    (Version 2.0)/Reference Section under FILE FORMATS.

EnableHeapChecking = 0 (Default)
                     1 (Enable)

     When enabled, Windows verifies that local and global heaps are
     properly linked and that handles point to appropriate objects.

     Windows checks the local heap when an application makes local
     memory calls.  Windows checks the global heap when an application
     makes global memory calls.


EnableSegmentChecksum = 0 (Turn Off)
                        1 (Default)

     When enabled, Windows verifies that code segments have not been
     altered by random memory overwrites when code segments are moved
     or discarded.


EnableFreeChecking = 0 (Default)
                     1 (Enable)

     When enabled, Windows uses the CC hexadecimal value to initialize
     all of memory.  Whenever an application allocates free memory,
     Windows verifies that it still contains CC hexadecimal values.
     When an application frees an object, the memory containing the
     object is initialized with CC hexadecimal values.

FreezeGlobalMotion = 0 (Default)
                     1 (Enable)

     When enabled, Windows prevents the movement of segments in memory.



EnableEmsDebug = 0 (Default)
                 1 (Enable)

     If Windows is using LIM 4.0 and you are trying to put breakpoints
     into DISCARDABLE LIBRARY CODE SEGMENTS, then EnableEMSDebug must
     be set.  The use of this flag should be avoided at all costs.  It
     slows the system down to unusability.

     This updates debugging tables such that debuggers can track segments
     which are loaded into expanded memory.


LRUSweepFrequency = 0
                    250 (Default) in ms.
     This sets how often the LRU list is updated.  the default is 250ms.
     The only real use is to set it to zero.  This allows reproducable
     memory conditions to track down overwrite bugs.


SwapProfile = 0 (Do nothing - NORMAL KERNEL)
              1 (record just swap calls/discards/and swap returns)
              2 (record swap calls/discards/swap returns/all calls through
                 trunks)

     If number is left out, 1 is assumed.

     This is used internaly.  By running a special version of kernel, a
     developer can get an accurate profile of all calls, swaps, discards,
     and swap returns that occur during a Windows session.  The version
     of kernel is usually called SKERNEL.EXE, SKERNEL.SYM.


[WIN386]

EmmSize = <KB Value>
     This is used to set the amount of Expanded Memory.  Leaving the value
     blank, will allocate as much available memory to expanded.

     If you are using a machine with a REV B ROM you could run into problems
     using expanded memory.
     With EMM enabled, you will hang when you ALT-TAB from a full-screen or
     exclusive mode VM, or when exitting Windows/386.  Any such ROM is
     defective and should be replaced.  A temporary work-around is to disable
     EMM by setting emmsize=0 in your win.ini.


WindowMemSize = <KB Value>

     The message "This application's display cannot be seen right
     now" when running an MSDOS application in a window indicates
     that Windows has run out of memory utilized for displaying
     the application. If you are not using EMM, try increasing
     the "windowmemsize=" value. If you are using EMM then use
     the "/n" switch when starting WIN386. This makes more
     memory available for displaying MSDOS applications in a
     window(and less available for Windows applications).
     For adjustments to the windowmemsize= setting in your win.ini
     to be effective, the emmsize= entry must be set to 0.

     If you want to set the windowmemsize= setting to a value other than 640,
     you must set your emmsize= setting to 0. For example, if you want to
     allocate 448 kilobytes for running Windows and Windows applications, put
     the following lines in your WIN.INI file:
          windowmemsize=448
          emmsize=0

     Page 25 in "Using Microsoft Windows/386" lists the minimum value for the
     windowmemsize= setting as 384. Generally this is true; however, if you
     have a large number of device drivers or a network installed on your
     system, you will need to set this value higher. If, when you start
     Windows/386, you receive the message "Not enough memory to run Windows,"
     try setting windowmemsize= to higher values in increments of 20K.


EMMPageFrame = <Address>

     This is set to the starting address where the 64K pageframe will begin.

     This will look for an available range of memory above A000h to load
     the expanded memory page frame.

    There is a configuration issue with IBM Token Ring adapters which cause
    problems with Windows/386. The IBM Token Ring adapter uses a RAM buffer in
    the option ROM address range (C000:0000 - E000:0000).  The default location
    for this RAM buffer is at DC00:0 - DE00:0.  Unfortunately, this buffer is
    normally not addressable and RAM/ROM search algorithms won't detect it.
    The Token Ring software only enables the buffer at interrupt time.  Thus,
    the Windows/386 EMM page frame selection logic does not detect this RAM
    when searching for option ROMs/RAM in the option ROM range and Windows/386
    will put its EMM page frame over the Token Ring Adapter's RAM buffer.
    The problem is complicated by the Token Ring's ROM, which is located at
    CC00:0 - CE00:0.  There are two options for configuring Token Ring and
    Windows/386 together: turn off EMM in Windows/386; or move the Token Ring
    ROM/RAM and specify the Windows/386 EMM Page Frame in the win.ini file.
    To allow EMM in Windows/386, try the following configuration.  Leave the
    Token Ring ROM at CC00:0, set the Token Ring RAM to C400:0, and set the
    Windows/386 EMM Page Frame to 0D000:0.  For the tokreui.com Token Ring
    driver use the following command to set the RAM to C400:0; "tokreui ,c400".
    For the IBM PC LAN 1.2 support drivers use the following config.sys line;
    "driver=DXMC0MOD.SYS ,C400".  To set the Windows/386 EMM Page Frame to

    D000:0 use the following win.ini entry; "emmpageframe=0D000".

     Be warned that these statements take away from memory reserved for
     hardware devices.  Therefor, they can have side effects such as
     disabling the network.  If the statements above cause the system to
     fail, then enter a page-frame setting other than 0C400, or start
     windows without using the network.

    [2.03: A new fix has been incorporated: put the line lastemmseg=<addr>
    into your win.ini, where <addr> is the segment address of the Token
    Ring network's RAM buffer.  The default address is DC00, so you would
    enter the line "lastemmseg=0DC00" into the [win386] section of your win.ini.]


LastEMMSeg = <Address>

     This sets the last address win386 will look for in establishing the 64K
     pageframe.  The default is set at E000h.


VirtualHdIrq = 0 (Turn Off)

               1 (Default)

     This is used mainly for systems using a non-standard disk controller.
     With the default, the ROM routine which performs the disk access is
     bypassed to allow Windows/286 to perrform it's own handling of the disk.
     By setting the VirtualHDIrq to 0, you allow the ROM routine to perform
     the access.


New Win 386 2.1 EMM Memory Switches:

There has been a problem on some configurations running WIN386 regarding
use of the memory from C000:0 to EFFF:F. WIN386 does a ROM RAM scan in this
area to try to find "holes" it can fill with EMM memory. This causes problems
with some adaptors which don't like their memory getting "touched", or with
adaptors that only map the memory in when they are using it, and leave it
unmapped at other times.

There are now two WIN.INI entries for the [WIN386] section which will allow
the user to override the default action of WIN386 and force WIN386 to treat
a memory address range in a user specified way regardless of what may be
occupying that address range.

        emmexclude=<range>
        emminclude=<range>

        <range> is startseg-endseg where startseg and endseg are segment
        values in the range C000 - EFFF. This field is identical to the
        range given on the /X and /I switches for most EMM drivers.

To include or exclude multiple ranges, use multiple lines:

        emmexclude=<range1>
        emmexclude=<range2>
        emmexclude=<range3>

        emminclude=<range1>
        emminclude=<range2>
        emminclude=<range3>

EMMEXCLUDE specifies a range which is to be excluded from consideration for
use as an EMM page. This has the side effect of turning off the ROM RAM
search code for the range.
EMMINCLUDE specifies a range which is to be considered for use as an EMM page
regardless of what may be there.

NOTES on range:

        o Ranges specify addresses between C000 and EFFF. Segment values
                less than C000 are changed to C000. Segment values greater
                than EFFF are changed to EFFF.

                B800-F3FF is changed to become C000-EFFF

        o Ranges specify 16K pages, so the startseg is rounded DOWN to the
                nearest 16K page boundary, and the endseg is rounded UP to
                the nearest 16K page boundary - 1.

                D300-D4FF is rounded to become D000-D7FF

                The 16K boundaries are at:

                        C000
                        C400

                        C800
                        CC00
                        D000
                        D400
                        D800
                        DC00
                        E000
                        E400
                        E800
                        EC00
                        F000

        o endseg must be greater than startseg (after above noted adjustments).
                Ranges that do not satisfy this are ignored.

        o Ranges are INCLUSIVE. thus:

                C000-D000 is rounded to C000-D3FF.

                To stop at D000, the correct range specification is:

                C000-CFFF
General NOTES:


        o EMMINCLUDE must be used very carefully.

            o   Remember that you are specifying a range that will be
                considered for EMM use REGARDLESS of whether there is any
                ROM or RAM there.

            o   Remember also about the rounding to 16K boundaries that
                will be done on the range!!!!!!!!!

            o   Failure to consider things carefully will crash the system, or
                defeat the ability to use a particular adaptor under WIN386.

        o EMMINCLUDE takes precedence over EMMEXCLUDE if you specify ranges
            which overlap. It is VERY STRONGLY recommended that you do not
            rely on overlapping range behavior as it may be changed in a
            future release.

        o EMMINCLUDE of a range does not guarantee that it will be used for

            EMM by WIN386. EMMEXCLUDE of a range does guarantee that it will
            not be used for EMM by WIN386.

        o The DEFAULT end of EMM consideration is not actually F000, it is
            E000. This is controled by the LASTEMMSEG win.ini entry. The
            default LASTEMMSEG value is 0E000. Users should be careful about
            putting in "LASTEMMSEG=0F000" because the behavior of the
            E000-F000 region is unpredictable on some machines.


EXAMPLE:

    [win386]
    ; Windows/386 will allocate the amount of memory specified in the
    ; windowmemsize entry to Windows.  The minimum memory that can be
    ; allocated is around 420, but this will vary depending upon whether
    ; or not you are running with a network, which version of DOS you
    ; are running with, and so on.  The emmsize entry fixes the MAXIMUM amount
    ; amount of extended memory that can be used as expanded memory at any
    ; one time.  Both your DOS applications and Windows itself will use this
    ; expanded memory.  You are probably best off leaving this entry blank,
    ; since Windows/386 will use a default value.

    windowmemsize=640
    emmsize=
    emmexclude=C400-C7FF
    emmexclude=D800-DFFF
    emminclude=D000-D7FF
    ;
    ; The AltEscape, AltEnter, and similar entries allow you to disable
    ; Windows/386's use of these special alt-key sequences.  Normally they
    ; should all be enabled (set to "on"), in which case these sequences are
    ; used by Windows/386 and are not seen by other applications.  If you need
    ; to run an application which relies on one of these sequences, you may
    ; set that entry to "off", then Windows/386 will ignore that key sequence,
    ; and it will be passed on to applications.
    altescape=on
    altenter=on
    altspace=on
    alttab=on
    altprintscn=on


New Windows/286 Switch


        Moveable EMS line

        The syntax is:

               win /l[+-]nnnn
        
        nnnn is the number of kb by which you want to
        move the line.  This number is currently limited
        to -16 <= nnnn <= +256.  In practice, raising the
        line by much above 100k usually drops you into
        small frame EMS.

        The /l flag is incompatible with the /n flag.
        Don't use both.

        The '+' in /l[+-]nnnn is in fact optional.
 