home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / SYSTEM / PORTS13.ZIP / PORTS13.DOC next >
Encoding:
Text File  |  1991-10-01  |  26.9 KB  |  679 lines

  1.  ╔══════════════════════════════════════════════════════════════════════════╗
  2.  ║STOP! ARRET! ALTO! HALT! STOP! ARRET! ALTO! HALT! STOP! ARRET! ALTO! HALT!║
  3.  ║                                                                          ║
  4.  ║                    This program can harm your HARDWARE...!               ║
  5.  ║                        YOU USE IT AT YOUR OWN RISK !!!                   ║
  6.  ║                      ABSOLUTELY NO LIABILITY ACCEPTED !!!                ║
  7.  ║                                                                          ║
  8.  ║The program will not run without the appropriate parameters, so there is  ║
  9.  ║LITTLE risk that you will run it accidentally. But be very careful if you ║
  10.  ║call it from a batch file...!                                             ║
  11.  ║                                                                          ║
  12.  ║STOP! ARRET! ALTO! HALT! STOP! ARRET! ALTO! HALT! STOP! ARRET! ALTO! HALT!║
  13.  ╚══════════════════════════════════════════════════════════════════════════╝
  14.  
  15.  
  16.                               PORTS.EXE
  17.                               ─────────
  18.  
  19.                          (Ver 1.3 - 19 Sep 91)
  20.  
  21.  
  22.  
  23.                      Copyright (c) and developed by
  24.  
  25.                               José Campione
  26.       2415 SouthVale Cr. U-25, Ottawa, Ont. K1B 4T9 (613) 523-4345.
  27.  
  28.                                    and
  29.  
  30.                           C. Robert Parkinson
  31.            5 Ramsgate, Ottawa, Ont. K1V 8M4, (613) 523-7299.
  32.  
  33.  
  34.                Program suggested by Micheline Johnson
  35.           (who also worked out the details for example #4).
  36.  
  37.                                 *  *  *
  38.  
  39.  NOTICE
  40.  ══════
  41.  
  42.      This program and every file distributed with it are copyright (c)
  43.  by the authors, who retain authorship both of the pre-compiled and 
  44.  compiled codes.  Their use and distribution are unrestricted, as long
  45.  as nobody gets any richer in the process.  Although these programs 
  46.  were developed to the best of the authors abilities, no guarantees
  47.  can be given as to their performance.  By using them, the user
  48.  accepts all risks and the authors decline all liability. 
  49.  
  50.  
  51.  
  52.  INTRODUCTION
  53.  ════════════
  54.  
  55.      PORTS.EXE is a small utility to read and/or write a byte or 
  56.  word value of an input/output (I/O) port.  This ability will enable 
  57.  you to alter some of the defaults for your system operation.  In 
  58.  particular, this program was designed to allow you to view and/or 
  59.  alter the CMOS configuration values in 80286 and higher systems, 
  60.  although it can be used for other purposes (see the WARNING below). 
  61.  
  62.      For those users who are not familiar with the Intel/Microsoft
  63.  I/O port address structure, please read the BACKGROUND section below
  64.  BEFORE you use this program.
  65.  
  66.  
  67.  
  68.  WARNING
  69.  ═══════
  70.  
  71.      This utility can alter the basic operation of your system.
  72.  DO NOT use it to write to the ports unless you thoroughly understand
  73.  what you are doing.  In particular, DO NOT write to any port which
  74.  is concerned with disk operations.  An incorrect value in another
  75.  location may crash your system, but an improper value in these
  76.  locations may corrupt your disk.  Be very careful to not get 
  77.  confused between decimal and hexadecimal values.  
  78.  
  79.      Merely reading a port may also disrupt your system operation,
  80.  although it will not harm any hardware.
  81.  
  82.      You have been warned!
  83.  
  84.  
  85.  
  86.  SYNTAX
  87.  ══════
  88.  
  89.      PORTS.EXE uses five possible first parameters.  The "u", "a"
  90.  and "w" parameters, while they may be useful in other circumstances,
  91.  were specifically created to deal with the CMOS RAM settings in 286
  92.  and higher systems.  The parameters are:
  93.  
  94.          i = In (from port).
  95.              Input/display a single byte from a port.
  96.  
  97.          o = Out (to port).
  98.              Output/send a single byte to a port.
  99.  
  100.          u = Out/In (to port 1/from port 2).
  101.              Output/send a single byte to a port, followed
  102.              by an input/display from a second port.
  103.              The optional parameter "#xxxx" (see below)
  104.              permits a delay of xxxx milliseconds to be
  105.              inserted between the two port accesses. 
  106.  
  107.          a = Out/Out (to port 1/to port 2).
  108.              Output/send a single byte to a port, followed
  109.              by an output/send of another byte to a second port.
  110.              The optional parameter "#xxxx" (see below)
  111.              permits a delay of xxxx milliseconds to be
  112.              inserted between the two port accesses. 
  113.  
  114.          w = Word out (to port).
  115.              Output/send a 2-byte word to a port.
  116.  
  117.  
  118.      Usage:
  119.      ─────
  120.  
  121.          C:\> PORTS i $INWORD <!>
  122.  
  123.          C:\> PORTS o $OUTWORD <byte value> <!>
  124.  
  125.          C:\> PORTS u $OUTWORD <byte value> $INWORD <!>
  126.  
  127.          C:\> PORTS a $OUTWORD <byte value> $OUTWORD <byte value> <!>
  128.  
  129.          C:\> PORTS w $OUTWORD <word value> <!>
  130.  
  131.  
  132.        Where:
  133.  
  134.        - INWORD and OUTWORD are port addresses.  These are not in the
  135.          normal "segment:offset" form, but rather they are in terms of
  136.          an "absolute" port address (e.g., "$061" for the speaker).
  137.          The addresses can be entered as hex or decimal numbers,
  138.          but hex addresses must be preceded by the "$" sign. (This is
  139.          Pascal's way of indicating a hex number).
  140.  
  141.        - <byte value> or <word value> is the decimal or hex value
  142.          that you wish written to the port.  Hex values must be
  143.          preceded by the "$" sign.
  144.  
  145.        - The optional "#xxxx" parameter will only function with the
  146.          first parameters "u" and "a", when making two successive
  147.          calls to ports.  In the syntax for this parameter, "xxxx"
  148.          represents any decimal number between (and including) 0 to
  149.          9999.  A string  representing a number within this range
  150.          will cause a delay of "xxxx" milliseconds between the first
  151.          and the second port call.  Any string not representing a
  152.          number within that range will cause this parameter to be
  153.          ignored (i.e., no delay between the port calls).
  154.          
  155.        - The optional "!" parameter causes the display on the screen 
  156.          of the value of the last input/output byte in decimal, hex 
  157.          and binary formats.  It will also display the delay value
  158.          if "#xxxx" was used.
  159.  
  160.        - Any positive integer below 65536 (0 to 65535 decimal, or 
  161.          $0 to $FFFF hex) is a valid word.  Similarly, any positive
  162.          integer below 256 (0 to 255 decimal, or $00 to $FF hex) is a
  163.          valid byte.  When entering bytes or words, $DF is equivalent
  164.          to $00DF and both are valid either as bytes or as words. 
  165.  
  166.        - Note that parameter "u" causes two successive calls. The 
  167.          first one is similar to a call using parameter "o" and the 
  168.          second one is similar to a call using parameter "i". 
  169.          Similarly, parameter "a" makes two successive calls 
  170.          equivalent to two separate calls using parameter "o".
  171.          Our testing on several systems has determined that these two 
  172.          successive calls (as, for example, those required to access 
  173.          the CMOS) could not be carried out by two successive
  174.          individual commands from the DOS prompt.  They require a
  175.          special "single step" operation with a single call to PORTS.
  176.  
  177.  
  178.  
  179.  CMOS CONFIGURATION
  180.  ══════════════════
  181.  
  182.      For 80286 and higher systems, configuration information is held
  183.  in battery-powered CMOS memory that retains the information even
  184.  when the computer is switched off.  That information, originally
  185.  entered through the software setup program, can be altered with
  186.  PORTS.EXE.  However, to do so you must know the CMOS address and the
  187.  desired value.  To display bytes in CMOS, use "PORTS u" (as in the 
  188.  example below).  To change a CMOS value, using the example below,
  189.  simply use "PORTS a" to output the CMOS address (byte) into port 70h
  190.  and output the desired byte value into port 71h.
  191.  
  192.  
  193.  Example:
  194.  ───────
  195.                 C:\>PORTS u $70 $14 $71 !
  196.  
  197.          This line causes the following display:
  198.  
  199.                 Port byte = 35d, 0023h, 00100011b.
  200.          
  201.          Similarly, the same command line can be entered using decimal
  202.          notation as:
  203.  
  204.                 C:\>PORTS u 112 20 113 !
  205.  
  206.          which would have caused exactly the same display.
  207.  
  208.          This command outputs byte $14 (a CMOS address) to port $70
  209.          and requests the input of the value currently held at that
  210.          CMOS address from port $71, which in this case happens to
  211.          contain byte $23.  In this example, the displayed byte
  212.          is the equipment byte held in the CMOS.  You can interpret
  213.          it as follows, remembering that bit 0 is the rightmost bit:
  214.  
  215.          Bits 6,7:      00 - 1 floppy drive
  216.                         01 - 2 floppy drives
  217.  
  218.          Bits 4,5:      00 - No monitor, or EGA or better.
  219.                         01 - 40 column, color.
  220.                         10 - 80 column, color.
  221.                         11 - monochrome.
  222.  
  223.          Bits 2,3:      (not used)  
  224.  
  225.          Bit  1  :      0  - math coprocessor not installed.
  226.                         1  - math coprocessor installed.
  227.  
  228.          Bit 0   :      0  - No floppies installed.
  229.                         1  - 1 or more floppies installed.
  230.  
  231.  
  232.  
  233.  ERRORLEVELS
  234.  ═══════════
  235.  
  236.      In all cases but one, the byte being addressed is returned as an
  237.  ASCII value in the exit errorlevel.  The exception is when using the
  238.  "w" parameter (out a 2-byte word to a port), when the returned
  239.  errorlevel will be 0.  This exit errorlevel capability makes PORTS
  240.  well suited for use in a batch file.  Use "PORTS i" with an
  241.  errorlevel test to confirm that this is the proper value to alter,
  242.  then use "PORTS u" with another errorlevel test to confirm that it
  243.  has indeed been changed to the value that you desire, branching to
  244.  an error routine in either case if the correct errorlevel is not
  245.  returned.
  246.  
  247.  
  248.  
  249.  BACKGROUND
  250.  ══════════
  251.  
  252.      The term "port" has two meanings, so this needs to be cleared
  253.  up first.  From a user perspective, "port" is normally thought of
  254.  as being a hardware connector.  The user is likely to consider that
  255.  he has, for example, two serial ports, one parallel port and,
  256.  perhaps, a mouse port and a game port.  However, to a programmer
  257.  the term "port" implies an access point to facilitate data
  258.  transfer, in other words, an input/output (I/O) address.  To
  259.  contrast the two meanings, consider that one serial "port" has, in
  260.  fact, eight separate but integral I/O "ports".  This document is
  261.  concerned solely with the I/O address meaning of the word "port".
  262.  
  263.      Any Intel 80x8x processor has two separate address modes, using
  264.  the same addressing pins.  The first mode addresses memory (i.e.,
  265.  normal RAM/ROM addressing).  The second mode, I/O port addressing,
  266.  while it uses some of the same numerical addresses as for RAM,
  267.  actually sends/receives the information to or from support chips
  268.  (e.g., the timer, the keyboard controller, etc.) or peripheral
  269.  devices (e.g., the disk controller, the graphics adapter, etc.).
  270.  All programming languages have built-in methods of differentiating
  271.  between the two modes of addressing.
  272.  
  273.      As we said before, I/O address ports are used by DOS for data
  274.  transfer.  The values in these locations govern that part of the
  275.  system which is external to the processor itself.  Therefore, the
  276.  ports allow direct access to the hardware.  Through ports you can
  277.  access components on the mother board, on expansion cards or even
  278.  devices external to the system proper, such as modems, printers,
  279.  etc.  Each port will have a different meaning for each particular
  280.  device and the use of any given port varies from chip to chip or
  281.  device to device.  Before using PORTS, check your technical
  282.  documentation for the motherboard, the expansion card or the device.
  283.  
  284.      Although we normally speak of the ports as one generic class,
  285.  they are actually divided into two types, CPU ports and DOS ports.
  286.  CPU ports (also known as "logical" ports) are directly accessible to
  287.  the CPU and govern such things as the speaker, keyboard, timer, disk
  288.  access, etc.  DOS ports are normally accessible to the processor
  289.  only through the use of DOS "interrupts".  They control high-level
  290.  data transfer via "serial" ports (e.g., COM1) and "parallel" ports
  291.  (e.g., LPT1).  Understanding this difference is essential for those
  292.  programmers who write at the hardware level.
  293.  
  294.      There are many differences in the port addressing schemes used
  295.  by various Intel processors, although newer processors are always a
  296.  superset of older ones.  These differences are necessarily also
  297.  supported by the specific ROM BIOS for that system type.  Because of
  298.  these differences, compatibility is normally attained by interacting
  299.  with the ports only through the processor itself or through DOS/BIOS
  300.  interrupts.  But sometimes, in order to achieve a specific purpose,
  301.  direct access to the hardware cannot be avoided; PORTS.EXE can do
  302.  this for you.
  303.  
  304.      Each port has a specific port number, or address.  In a 16-bit
  305.  bus system (8086, 80286 and above) this allows 65,535 ports (0 to
  306.  FFFFh). As of 1990, only port addresses 000h to 3FFh had been
  307.  assigned.  In an XT system, because of the 8-bit external bus, the
  308.  ports are limited to a maximum of 1,024.
  309.  
  310.      Five kinds of operations are usually performed on ports:
  311.  
  312.      1) input (receive from port) a byte;
  313.  
  314.      2) output (send to port) a byte;
  315.  
  316.      3) output (send to a port) a byte and input (receive) a byte
  317.         from a second port in one single operation; 
  318.  
  319.      4) output (send to a port) a byte and output (send to the same
  320.         or another port) another byte in one single operation; and
  321.       
  322.      5) output (send to a port) a word (two consecutive bytes in one
  323.         single step). 
  324.  
  325.      This last "word" operation is necessary because many hardware
  326.  functions are triggered immediately by any operation on the
  327.  applicable port.  Any attempt to send two consecutive single-byte
  328.  values to this port would necessarily fail.
  329.  
  330.      Some port operations require two successive bytes sent to the
  331.  same port, but the hardware may require a small delay between these
  332.  bytes.  PORTS can interpose this delay if required.
  333.  
  334.      Many ports are "bit-mapped", in that each bit has a specific
  335.  function.  For example, port 14h is the so-called "equipment byte",
  336.  since it specifies, in bit values, the elementary hardware
  337.  configuration of your system.  Similarily, port 61h uses only the
  338.  first two bits to control the speaker, the remaining six being used
  339.  for unrelated purposes.  Changing bit-mapped ports with PORTS is a
  340.  complex operation, requiring the conversion to and from binary
  341.  values.  See Example #3 below.  To assist in this conversion, you
  342.  may wish to use the PC Magazine utility CONVERT.COM.
  343.  
  344.      There are also many anomalies in the way in which ports respond.
  345.  These are dependent upon the hardware being addressed, the system
  346.  being used, the manufacturer's design whims, etc.  As these
  347.  anomalies are very much system-specific, trial and error (hopefully
  348.  not too much error!) is the only sure test.
  349.  
  350.      This small technical background is NOT designed to make you
  351.  familiar with I/O ports and their usage.  Please consult any
  352.  reliable programmer's handbook.
  353.  
  354.  
  355.  
  356.  EXAMPLES
  357.  ════════
  358.  
  359.  Example #1 - Controlling the Speaker
  360.  ────────────────────────────────────
  361.  
  362.      Your computer's speaker is controlled by bits 0 and 1 of the
  363.  bit-mapped byte found at port 61h.  If both bits are set to 1 you
  364.  will hear a continuous tone in the same frequency as the infamous
  365.  DOS beep.  To vary the tone, programs must use ports 42h and 43h to
  366.  tell the system programmable timer chip how to vary the output
  367.  frequency.  That's beyond what we want to demonstrate here; we're
  368.  just going to show you how to output sound.
  369.  
  370.      The remaining bits 2 to 7 of the byte at port 61h are uses for
  371.  other purposes, so don't disturb these.  This means that we have to
  372.  first find the existing byte at that port.  Do that with this
  373.  command:
  374.  
  375.            "PORTS o $061 !"
  376.  
  377.      Now take the binary byte on the screen (e.g., 01001000 or 48h)
  378.  and change it so that bits 0 and 1 are set to 1 (e.g., 01001011 or
  379.  4Bh).  Make certain that you do not alter the other 6 bits.  The
  380.  easiest way to do this conversion is to use the CONVERT.COM utility
  381.  from PC Magazine, but you can do it manually using the technique
  382.  illustrated in Example #3.
  383.  
  384.      If we just output the changed byte to port 61h, we will get a
  385.  continuous tone and we will then have to output the original byte
  386.  to turn it off.  But we can use the PORTS "a" parameter to do both,
  387.  inserting a variable delay so that we can tell that our ports call
  388.  does work.  Using the example byte, this is the command:
  389.  
  390.            "PORTS a $061 $04B $061 $048 #500"
  391.     
  392.      Change the "#500" to vary the duration of the sound.
  393.  
  394.  
  395.  
  396.  Example #2 - Initializing the Printer
  397.  ─────────────────────────────────────
  398.  
  399.      Here is a simple example to reset a printer connected to your
  400.  system to the printer's built-in default settings, assuming that it
  401.  is a parallel port Centronics-compatible printer.  It also assumes
  402.  that your printer is addressed through LPT1.  While this type of
  403.  reinitialization can more easily be done using your printer's
  404.  built-in "escape" sequences, this example merely illustrates one of
  405.  the capabilities of PORTS.  The third of the LPT1 I/O port addresses
  406.  is the one that controls the initialization (INIT) line to the
  407.  printer.  To initialize the printer we have to drop the normal +5V
  408.  signal on that INIT line to 0V, then restore it to +5V again.  To
  409.  do this with a software routine, we have to determine that specific
  410.  I/O address for our system, then send two sequential values to that
  411.  port; one to set bit 2 to zero, then one to set bit 2 to 1.
  412.  
  413.      However, since the INIT line has to be held low (0V) for long
  414.  enough for the printer to notice, we must either use two separate
  415.  PORTS "o" calls or, preferably, use a PORTS "a" call to the same
  416.  I/O address but with a delay ("#xxxx") between the two calls.  Here
  417.  is the routine:
  418.  
  419.     - To find the specific I/O address for your system, we will use
  420.       DEBUG.  However, you could use any other memory editor.  At the
  421.       DEBUG "-" prompt, enter "d 0040:0008".  The values in the first
  422.       two bytes are the first LPT1 I/O address.  On our test system,
  423.       DEBUG gave "BC 03".  Remembering to reverse the order, we get
  424.       an I/O address of "03BCh".  But we want the THIRD I/O address,
  425.       so we add 2 (in hex) to that, giving us "03BEh" as the INIT
  426.       port address.
  427.  
  428.     - Now, we have to drop bit 2 to 0, then raise it to 1 again.  So
  429.       we output binary 11101000 (232) to the port.  Counting from 0
  430.       on the right, you can see that bit 2 is indeed a 0.  To raise
  431.       bit 2 to 1, we then output binary 11101100 (236) to the same
  432.       port.
  433.  
  434.     - We're ready to try our test.  Execute the following PORTS
  435.       command, remembering to substitute your own I/O port address if
  436.       it differs from 03BEh:
  437.  
  438.         "PORTS a $03BE 232 $03BE 236 #50!"
  439.  
  440.  
  441.      Experiment with different values for "#xxxx" to find the minimum
  442.  delay that your printer requires.  On the test system, for example,
  443.  a delay as small as 1 millisecond was acceptable.
  444.  
  445.  
  446.  
  447.  Example #3 - Setting Bright Text Background Colours
  448.  ───────────────────────────────────────────────────
  449.  
  450.      Try this test if your system has a CGA card.  Only use it if you
  451.  have a CGA card, as it may not work with other adapters.  If your
  452.  VGA or SuperVGA adapter is 100% EGA compatible (e.g., the ATI VGA
  453.  Wonder) this test will work.  PORTS does not check for the adapter
  454.  type.
  455.  
  456.      You can modify the blinking bit that causes blinking characters
  457.  on the screen, so that, instead of blinking, it will enable the use
  458.  of bright background colors.
  459.  
  460.      Most CGA cards can be accessed through port 03D8h ($03D8). The 
  461.  configuration word of the CGA card can be obtained from the BIOS (it
  462.  is the word at address $0040:$0065).  Usually, this word contains the
  463.  value $3029 (if you look into this address using DEBUG, remember that 
  464.  DOS inverts the bytes in a word), which in binary is: 
  465.  
  466.  
  467.                     3    0    2    9 h
  468.                  0011 0000 0010 1001 b
  469.                              ^
  470.  
  471.      To toggle blinking, bit 5 has to be reset (indicated with the
  472.  caret). This can be done by "ANDing" 3029h with $DF:
  473.  
  474.  
  475.                     3    0    2    9 h
  476.                  0011 0000 0010 1001 b
  477.  
  478.          AND                  D    F h
  479.                  0000 0000 1101 1111 b
  480.                              ^
  481.                  ─────────────────────
  482.  
  483.                     3    0    0    9 h
  484.                  0011 0000 0000 1001 b
  485.  
  486.  
  487.  
  488.      So enter the following:
  489.  
  490.              C:\>PORTS !
  491.  
  492.      And you'll get the ports message with the blinking string
  493.  "WARNING!".
  494.  
  495.      Then enter:
  496.  
  497.              C:\>PORTS w $0D38 $3009 !
  498.  
  499.      If everything went smoothly, you'll see that the blinking of
  500.  "WARNING!" has ceased and that, instead, it is being displayed on
  501.  a bright background color. 
  502.  
  503.      To change your display back to normal, enter:
  504.  
  505.              C:\>PORTS w $0D38 $3029 !
  506.  
  507.      Or replace $3029 with whatever word was originally found at
  508.  address $0040:$0065 in your system. 
  509.  
  510.  
  511.  
  512.  Example #4 - Denying Access to Drives
  513.  ─────────────────────────────────────
  514.  
  515.      For 286/386/486 systems only.
  516.  
  517.  
  518.        ╔════════════════════════════════════════════════════╗
  519.        ║                   CAUTION                          ║
  520.        ║                   ───────                          ║
  521.        ║  This procedure, if improperly done, can result    ║
  522.        ║  in your having great difficulty accessing         ║
  523.        ║  your computer system.                             ║
  524.        ║                                                    ║
  525.        ║  Improper inactivation of a hard drive can be      ║
  526.        ║  rectified by booting from a floppy diskette       ║
  527.        ║  and restoring the CMOS from the setup diskette.   ║
  528.        ║                                                    ║
  529.        ║  Improper inactivation of floppy drives is of      ║
  530.        ║  more concern.  If you have provided for no way    ║
  531.        ║  of restoring the CMOS from the hard drive, then   ║
  532.        ║  you'll probably need to return to your dealer.    ║
  533.        ║                                                    ║
  534.        ║  UNDER NO CIRCUMSTANCES inactivate all floppy      ║
  535.        ║  and hard drives.  Should you do so, even your     ║
  536.        ║  dealer will be very unhappy.                      ║
  537.        ║                                                    ║
  538.        ╚════════════════════════════════════════════════════╝
  539.  
  540.  
  541.      There are several password protection programs that permit the
  542.  hiding or disabling of one or more storage devices.  One limitation
  543.  of these programs is that they can usually be bypassed by booting
  544.  with a system (bootable) diskette from the A: drive. 
  545.  
  546.      To overcome this security limitation, it is possible to switch
  547.  off the A: and B: drives by appropriate editing of the CMOS RAM. 
  548.  
  549.      The retrieval and input of the CMOS configuration setup
  550.  information from and to the CMOS EEPROM chip can be done by using
  551.  the PC Magazine utilities CMOSGET and CMOSPUT.  In a manual
  552.  operation, the byte file generated by CMOSGET can be edited using
  553.  any good binary editor and then uploaded to the system using
  554.  CMOSPUT.
  555.  
  556.      However, PORTS permits a more elegant and practical approach:
  557.  
  558.  
  559.  1) Back up the complete hard drive that you wish to hide.
  560.  
  561.  
  562.  2) Make a copy of the CMOS RAM, using "CMOSGET > CMOS.DAT".
  563.  
  564.  
  565.  3) Make a bootable system diskette with the following programs (in
  566.     addition to the two hidden system files) on it, which will
  567.     permit everything to be put back to normal if there are any 
  568.     problems:
  569.  
  570.              COMMAND.COM  
  571.              CMOSPUT.COM 
  572.              CMOS.DAT  
  573.              PORTS.EXE  
  574.  
  575.  
  576.  4) Note the contents of your CMOS RAM at address 10h (floppy
  577.     drives), address 12h (hard drives) and at addresses 2E,2Fh
  578.     (checksum).  An example of the contents might be:
  579.  
  580.       - at address 10h, the value 24h (1.2M and 1.4M floppy drives).
  581.  
  582.       - at address 12h, the value F0h (single hard drive type Fh).
  583.  
  584.       - at address 2E,2Fh, the checksum value 04D4h. 
  585.  
  586.  
  587.  5) To switch off the floppy drives, address 10h has to be cleared
  588.     (subtract 24h) and to switch off the hard drive, address 12h has
  589.     to be cleared (subtract F0h).  Therefore, switching off the
  590.     floppy drives requires a checksum of 04B0h.  If you are switching
  591.     off the hard drive, a checksum of 03E4h is required.
  592.  
  593.  
  594.  6) Put the following batch files on the hard drive:
  595.  
  596.       FLOFF.BAT
  597.       ─────────
  598.  
  599.       ports a $70 $10 $71 $00 !
  600.       ports a $70 $2E $71 $04 !
  601.       ports a $70 $2F $71 $B0 !
  602.  
  603.     and 
  604.  
  605.       FLON.BAT
  606.       ────────
  607.  
  608.       ports a $70 $10 $71 $24 !
  609.       ports a $70 $2E $71 $04 !
  610.       ports a $70 $2F $71 $D4 !
  611.  
  612.  
  613.  7) Put the following batch files on the bootable floppy diskette:
  614.  
  615.       HDOFF.BAT
  616.       ─────────
  617.  
  618.       ports a $70 $12 $71 $00 !
  619.       ports a $70 $2E $71 $03 !
  620.       ports a $70 $2F $71 $E4 !
  621.  
  622.     and
  623.  
  624.       HDON.BAT
  625.       ────────
  626.  
  627.       ports a $70 $12 $71 $F0 !
  628.       ports a $70 $2E $71 $04 !
  629.       ports a $70 $2F $71 $D4 !
  630.  
  631.  
  632.  8) In the above examples, the CMOS RAM port addresses are $70 and
  633.     $71.  The parameters following $70 and $71 are the CMOS RAM
  634.     internal address and the data to be written there, respectively.
  635.     The "$" is the Pascal representation for hex numbers, used by
  636.     PORTS.
  637.  
  638.  
  639.  To Turn Off the Hard Drive
  640.  ──────────────────────────
  641.  
  642.  8) Run HDOFF from the bootable diskette in floppy drive A:.  To 
  643.     test whether you have been successful in hiding the hard drive,
  644.     do a boot, without the floppy diskette in drive A:.  If your
  645.     efforts have been a success, the computer will now find no hard
  646.     drive, and will give the prompt:
  647.  
  648.           "Insert BOOT diskette in drive A:"
  649.  
  650.     After booting from the floppy drive, any request to log on to
  651.     the hard drive causes the display of the DOS error message:
  652.  
  653.           "Invalid drive specification".
  654.  
  655.  
  656.  9) To return everything back to normal, run HDON from the floppy
  657.     drive and reboot.
  658.  
  659.  
  660.  To Turn Off the Floppy Drives
  661.  ─────────────────────────────
  662.  
  663.  10) Run FLOFF from the hard drive, and reboot.  The computer will
  664.      not even check the floppy drives to see if they contain
  665.      diskettes.  Instead, it will boot straight from the hard drive.
  666.      A request to log on to one of the floppy drives, regardless of
  667.      the presence of a diskette in that drive, causes the display of
  668.      the DOS error message:
  669.  
  670.           "Not ready reading drive A
  671.            Abort, Retry, Fail ?" 
  672.  
  673.  
  674.  11) To return everything back to normal, run FLON from the hard
  675.      drive and reboot.
  676.  
  677.                                *  *  *
  678. 
  679.