          SWTEST -- Switching methods test program
                              
                   Phar Lap Software, Inc.
           60 Aberdeen Ave., Cambridge, MA  02138
             (617) 661 1510, FAX (617) 876-2972
                  tech-support@pharlap.com

                     November 29, 1990



SWTEST is a program for testing the protected/real mode and
A20 switching methods.  It is linked with the switch
routines, and can also load and run the switch routines in
an external switch.bin file.

SWTEST can be run so that it simply outputs its results to
the display, or it can run in an interactive mode, where
user and machine information is interrogated and output to
the swtest.out file along with the test results.  When
outputting to the swtest.out file, the file is opened in
append mode so that any old information will be preserved.
This allows for easy testing of multiple machines by running
the SWTEST program from a floppy disk (and writing the
swtest.out file to the floppy).  An additional file named
swtest.inf is created and updated to save user and machine
information for subsequent tests.

SWTEST reports the following information:
     (1)  The version of SWTEST and of the switch code.
     (2)  The BIOS "signature", a 32-bit checksum of
          selected portions of the BIOS ROM.
     (3)  The date of the BIOS, if found in the location
          where the IBM PC stores its BIOS date.
     (4)  The Machine ID, a number which results from the
          identification of individual machines based on the
          BIOS signature or other techniques.  A Machine ID
          of zero indicates that the individual machine
          could not be identified.
     (5)  The A20 switch method name and number.
     (6)  The Reset method name and number.
     (7)  The Protected/Real Mode switch method name and
          number.
     (8)  The average, minimum, and maximum times (in
          microseconds) to switch to protected mode, switch
          back to real mode, and the combined totals.

A number of options can be selected on the command line.
Each option must start with a '/', and the options must each
be separated by at least one space.  The available options
are:
     /h   = print out help information (don't run any tests)
     /s## = use switch method number ##
     /a## = use A20 method number ##
     /r## = use reset method number ##
     /n## = run ## test passes before reporting results
          (default is 1000 passes)
     /f## = set switch flags to ##
     /x   = use external switch.bin file
     /i   = create swtest.inf file if it does not exist
     /d   = output test results to display only

For example, the command line
     swtest /s2 /a1 /i
would cause the switch method number to be set to 2, the A20
method number to be set to 1, and a swtest.inf file to be
created if it didn't already exist.

If any of the method numbers are not given, the switch
routines will determine a default method to use.  The
general intention is that appropriate method numbers will be
chosen based on the machine ID or other identifying factors.

If neither the /i nor /d option is given, then the existence
of the swtest.inf file will determine whether or not user
and machine information is interrogated and output is
written to the switch.out file.  If the /i option is given,
then the swtest.inf will be created if it doesn't already
exist, and data will be always be written to the swtest.out
file.  If the /d option is given, then nothing will be
output to the swtest.out file, even if the swtest.inf file
already exists.

The current mode switch method numbers are:
     1 = SURE
     2 = AT
     3 = SLOW
     4 = VCPI
     5 = 386

The current A20 switch method numbers are:
     1 = AT
     2 = PS2
     3 = VECTRA
     4 = 6300
     5 = XMS
     6 = ACER
     7 = ZENITH
     8 = NEAT
     9 = PHOENIX
     10 = TOSHIBA
     11 = WYSE

The current reset method numbers are:
     1 = STANDARD
     2 = 8042

It is possible to control certain operations with the switch
flags.  Each flag is a bit of the flags word, and multiple
flags can be specified by adding their values together.  The
/f## command option is used to set the flags, and the flags
value is given as a decimal (base 10) number.  The current
switch flags are:
     1 = Skip test for AT method.  Normally, if the machine
          cannot be identified through the internal machine
          table, an attempt is made during initialization to
          try the AT switching method, checking for a
          reprogramming of the 8259 interrupt controllers
          and whether the BIOS enables interrupts when
          switching.  This flag skips this test and just
          chooses the SURE switch method, which is generally
          slower than the AT method.
     2 = Unused.
     4 = Force A20 to be disabled whenever entering real
          mode.  Some mode switch methods normally enable
          the A20 line during initialization and leave it
          enabled throughout execution.  This flag causes
          the A20 line to be disabled on every switch to
          real mode, and to be re-enabled on every switch to
          protected mode.

