MCA identification utility - IDMCA
==================================

Introduction
------------

IDMCA is a simple utility for displaying card IDs and descriptions for
the contents of slots on an MCA machine.  It is heavily based on Peter
Wendt's excellent program QBMCA, but some work has been done to speed up
loading and execution (primarily by making things smaller).

Files provided
--------------

IDMCA.EXE       - the IDMCA program
REPMCA.EXE      - report version of IDMCA (for output to file or printer)
MCA.BIN         - MCA card description database (compressed)
MCA.DAT         - MCA card description database (text file)
REFSTAMP.COM    - program to place reference disk signature on diskette
COMPDAT.EXE     - program for generating new MCA.BIN from MCA.DAT
README.TXT      - this file

Using IDMCA
-----------

Only two files are required; IDMCA.EXE, and the data file MCA.BIN.  To
use the program, simply run it; MCA.BIN must be in the current directory
when this is done.  Output is self explanatory.

Using REPMCA
------------

REPMCA.EXE is provided for use when IDMCA cannot be used.  One example
of such a situation is if there is a display malfunction.  REPMCA
generates its report to standard output, so this can be redirected to a
file or a printer; for example:

          REPMCA > PRN               (to printer)
    or
          REPMCA > MCA.REP           (to a file)

Typically, the call to REPMCA would be placed in the AUTOEXEC.BAT file
of a bootable diskette, which could then be booted 'blind'.  The MCA.BIN
file is required, as for IDMCA.

Bootable diskettes
------------------

Both IDMCA and REPMCA are most useful when run from a bootable diskette,
via AUTOEXEC.BAT.  The bootable diskette is even more useful if it is
set up to appear as a PS/2 reference disk; as such, it will boot without
any intervention even if there are configuration errors.

The instructions below assume that you are preparing the diskette in
drive A:; substitute another drive letter as appropriate.

To make a bootable diskette, use the DOS command:

          FORMAT A: /S

Then, run the program REFSTAMP.COM to patch the diskette to make it
appear as a reference disk.  All this does is to alter three bytes in
the boot sector; these are examined by the PS/2 BIOS and are used to
allow a boot in the presence of a configuration error.  As a bonus,
machines with a reference partition on the hard drive will temporarily
make that available as drive C:, which is useful if you need to clean
out unwanted files.  To run REFSTAMP:

          REFSTAMP A:

Now, copy IDMCA.EXE and MCA.BIN to the diskette.  If you wish, make an
AUTOEXEC.BAT file containing just:

          IDMCA

(one is included with this package, with a couple of extra useful lines
in it; a minimal CONFIG.SYS is also provided).  The disk is now ready.
Modify as required to use REPMCA.

If you are using Windows 95, it is safest to do the above in standalone
DOS mode.  The bytes patched by REFSTAMP.COM are often corrupted by
various Windows 95 commands (even something as simple as DIR).  If this
happens, simply re-run REFSTAMP.COM.

Building a new MCA.BIN file
---------------------------

MCA.BIN is a compressed file.  MCA.DAT is the ASCII equivalent.  If you
acquire a new MCA.DAT, or edit the existing one, make a new MCA.BIN by
typing the command:

          COMPDAT MCA.DAT MCA.BIN

MCA.DAT is not needed when actually running IDMCA or REPMCA.

Differences from QBMCA
----------------------

The main difference from QBMCA is a performance improvement.  IDMCA was
written partly (there were other reasons, as part of a larger project)
because I spent hours sorting through unidentified cards, waiting for
QBMCA to load and then scan MCA.DAT.  No criticism; it is a nice program
that is very flexible.  I changed a few things in the quest for small
size.  These appear below.

1. MCA.DAT is replaced by MCA.BIN, which is a lot smaller. It is easy to
   generate a new MCA.BIN from MCA.DAT, though.
2. All card descriptions now have a limited character set. Only upper case
   letters, digits, and some punctuation symbols are permitted.
3. The screen colours cannot be changed.
4. There is no configuration file. All is fixed.
5. There is no report mode in IDMCA; use REPMCA instead.
6. Only English is supported.
7. IDMCA is written in Power C, with some strange programming techniques
   used to reduce the use of the (large) run-time library. This makes the
   program file rather less than 5K in size.

Technical notes
---------------

For those who are interested, here is a brief description of the
program's internals.

The MCA.BIN file is generated by a separate program, COMPDAT.  This
reads the MCA.DAT file and builds three arrays.  One is an array of all
the different words in MCA.DAT; these are stored once each, packed five
to a 32-bit word in a special 6-bit code.  The second array is a list of
card IDs (searched sequentially) interleaved with pointers into the word
array.  The third array is a bitmap used to help administer the second
array (a bit indicates which entries are card IDs and which are word
pointers).  All three arrays are stored as images in MCA.BIN, together
with the count of adapters supported.

The screen framework (lines, text, etc) was designed using an editor
(TEDIT on OS/2).  A program (not supplied with the distribution) was
written to generate a run-length compressed form of the screen image,
and turn it into C source in the form of an array of 32-bit data items.
This is included in the IDMCA source.

IDMCA itself reads and decompresses the screen image, and has a
table-driven colour attribute selector (two bytes per screen line).  The
screen is written using low level BIOS calls to avoid pulling in large
amounts of C run-time overhead.  MCA.BIN is read using another low-level
method (direct DOS calls via INT 21H) to avoid pulling in the C I/O
library.  Number conversion (very little needed) is done internally to
avoid the overhead of all the 'printf' formatting code.  The actual code
to read the I/O ports for POS information is tiny anyway.  Keyboard
handling is done using the BIOS.

The result is a very small program! Probably not worth the effort but I
enjoyed it!

REPMCA uses exactly the same code for handling MCA.BIN.  It uses
standard I/O calls to generate its output; this shows in its
(paradoxically) much bigger size.  But then it isn't used very often.

Acknowledgement
---------------

A big thank you to Peter Wendt for lots of things: the screen design
(stolen from his QBMCA program); the MCA.DAT file; the MODIFY.* files;
the whole idea.

Last updates
------------

20th January 2000; included newer version of REFSTAMP.

17th January 2000; updated for new MCA.DAT and MCA.BIN. Now covers 1352
different IDs.

Bob Eager
rde@tavi.co.uk
http://www.tavi.co.uk/ps2pages/
January 2000

