                           A Critical Error Handler
                   Copyright 1990,1991 by TANSTAAFL Software
                          Version 1.20 July 20, 1991

    CRITTER is a terminate and stay resident critical error handler.
    CRITTER replaces DOS's "abort, retry, ignore" message with a pop-up
    window that restores the screen when finished processing the error.
    This version of CRITTER adds printer logging of all non-printer
    errors and is certified for use with MS-DOS 5.0.

    Instructions For Use
    --------------------

        At some point in your AUTOEXEC.BAT file, type in the command
        'CRITTER'.  The command line parameters below may also be
        inserted.

        CRITTER [/U] [/M] [/S] [/Boptions] [/Toptions] [/Noptions]
                [/Aresponse] [/Otimeout] [/Lprinter]

                /U      Unload the TSR.  Like all TSR's that allow
                        themselves to be unloaded, this feature only
                        works if this TSR was the last one loaded.
                        This TSR will unload correctly from high DOS
                        RAM (above 640K).

                /M      Monochrome switch.  This allows correct
                        display on monochrome monitors connected
                        to color display adapters.

                /S      Sound switch.  This turns off the beep when
                        an error is detected.  Normally a beep is
                        generated to signal an error.

                /B      Allows setting border colors (see below).

                /T      Allows setting title colors (see below).

                /N      Allows setting normal text colors (see below).

                /A      Allows automatic response to an error.
                        Response can be one of the following:

                        Response Action         Response Action
                        ---------------------------------------

                        A        Abort          R        Retry
                        I        Ignore         F        Fail
                        S        Soft reboot    H        Hard reboot

                /O      Allows user to specify the number of seconds
                        to wait for a user response before triggering
                        the automatic response specified by the /A
                        option.  If /A is specified and /O is not, no
                        screen will be shown and the automatic response
                        will take effect immediately.

                /L      Printer log.  Allows the user to specify a
                        printer number to log errors to.  Valid printer
                        numbers are 1, 2, or 3 and correspond to printers
                        on LPT1, LPT2, or LPT3 respectively.



        Color Options
        -------------

        Each color command is followed by characters that determine the
        color to use.  Each color is designated by a single character, as
        indicated by the chart below.  If the character is in upper case,
        it sets the background color.  A lower case character sets the
        foreground color.  Adding a [+] to the string makes the fore-
        ground color bright, while adding a [*] makes it blink.  Color
        commands may be used in any order.

        Color           Character       Color           Character
        ---------------------------------------------------------
        Black           K, k            Blue            B, b
        Green           G, g            Cyan            C, c
        Red             R, r            Magenta         M, m
        Yellow          Y, y            White           W, w
        Bright          +               Blink           *

        Examples

        /bwK            border is dim white on black
        /ty+*R          title is blinking bright yellow on red
        /ncB            text is cyan on blue

        Automatic Response
        ------------------

        The automatic response feature allows the user to specify a
        default action and timeout duration.  If a critical error occurs
        and the timeout value is specified, CRITTER shows the error
        window and waits for a key to be pressed as usual (A-abort,
        R-retry, etc).  The window will now contain an extra countdown
        timer line.  If the user does not respond before this count
        reaches zero, then the automatic response is triggered.  All
        four possible responses to the error are supported (Abort, Retry,
        Ignore, and Fail).  Not all errors support all responses, however,
        Abort is always enabled, as is Fail on DOS versions 3.x, 4.x & 5.x.

        The automatic response unit can also reboot the computer as a
        default response.  Either a hard (reset) or soft (Ctrl-Alt-Del)
        reboot can be triggered.  This is useful for network or BBS
        systems that must run unattended.

        The soft reboot feature does not work consistently on some PCs.
        This seems to be caused by minor BIOS incompatibilities.  Before
        relying on a soft reboot, test it once to insure it works on
        your computer.

        Printer Logging
        ---------------

        With the printer logging feature, errors detected by Critter may
        be logged to your printer.  This is particularly handy when used
        in conjunction with the automatic response feature.  The error log
        contains the same three error lines displayed when CRITTER pops up,
        preceded by a header line and followed by a blank line...

            Critical Error Report from Critter follows:
            Drive not ready
            Read error on Drive A:
            Located in File Allocation Table

    Critical Error Handler Theory
    -----------------------------

        Critical errors are caused by hardware errors, generally in disk
        drives.  These errors may be minor (such as printer out of paper,
        or drive door open) or fairly catastrophic (like a scrambled FAT
        or dead hard disk).  A critical error can be caused by virtually
        any DOS call EXCEPT interrupts 25h and 26h (Absolute Disk Read &
        Write).  A critical error is associated with a device and can be
        either a block device (disk drives) or a character device
        (printer, keyboard, clock, etc.).  Each time the error handler
        is called, parameters are passed that indicate which error
        occured and where it happened.

        The DOS critical error handler is entered via software interrupt
        24.  DOS will allow a program to replace the DOS critical error
        handler with its own, but only for the duration of program
        execution.  When the program exits, DOS replaces the address of
        the program's handler, routing all further critical errors to DOS.
        CRITTER patches the resident portion of COMMAND.COM so that
        CRITTER has control of critical errors.  The disk file COMMAND.COM
        is NOT changed.  Due to the unusual way DOS handles INT 24,
        CRITTER can only be unloaded with the /U command line option.  If
        a TSR manager is used (such as MARK and RELEASE), the resident
        portion of COMMAND.COM will not be "unpatched" and the next
        critical error will cause the computer to loop until reset.
        
        The CRITTER critical error handler will give the following
        information:

                Error (DOS)     Write protected disk
                                Unknown unit
                                Drive not ready
                                Unknown command
                                CRC error in data
                                Bad drive request
                                Seek error
                                Unknown media type
                                Sector not found
                                Printer out of paper
                                Write fault
                                Read fault
                                General failure
                                Sharing violation
                                Lock violation
                                Invalid disk change
                                FCB unavailable
                                Sharing buffer overflow

                Error (Network) Network busy
                                Network device no longer exists
                                NetBIOS command limit exceeded
                                Network adapter hardware error
                                Incorrect response from network
                                Incompatible remote adapter
                                Print queue full
                                Not enough space for print file
                                Print file was deleted
                                Network name was deleted
                Error Cause     Read operation
                                Write operation

                Error Location  System area
                                File Allocation Table
                                Directory
                                Data area
                                Internal copy of FAT

                Other Info      (char)  Device name
                                (block) Drive designator

        Possible responses to a critical error are Abort, Ignore, Retry,
        or Fail.  Not all responses are possible at all times -- it
        depends on the error and the version of DOS.  The CRITTER software
        enables only those responses that DOS will allow at the time.

    Test Results
    ------------

        Unfortunately, this software is hard to completely test.  Several
        easy errors can be generated.  These include the write protect
        error, the drive not ready error, the paper out error, and the
        read & write faults.  Other errors could be tested if they were
        physically produced, such as unplugging the clock chip or crashing
        the hard disk (not recommended).

        CRITTER was tested with various DOS versions from 2.1 up through
        5.00.  It was tested with various programs and was found to allow
        the tested program to install its own error handler for the
        duration of its execution.  Upon return to DOS, CRITTER continued
        to handle errors correctly.  For those text mode programs that
        don't install their own error handlers, CRITTER takes care of it
        for them.

        CRITTER can be loaded high with the loadhigh command under DOS 5.

        CRITTER should work with all programs (either by working or by
        getting out of the way); it has been tested with the following
        programs:

        Brief 3.0                       Dbase III Plus
        Quattro Professional            Paradox 3.0
        Procomm Plus                    PC Tools 5.5 & 6.0
        Windows 3.0                     Microsoft C 5.1, 6.0
        Turbo C++, Borland C++          Microsoft Assembler 5.1

        CRITTER does not work in the DOS compatibility box under OS/2.

        In the event that the display is in graphics mode, CRITTER will
        use the DOS handler.  This will result in the screen being
        scrolled.  Most programs that use graphics modes do contain their
        own critical error handlers.

    Files In This Archive Include:
    ------------------------------

        critter.txt     (this file)
        critter.exe     CRITTER program


    Future Enhancements
    -------------------

        No future enhancements are planned.  If you desire a new feature,
        please contact the authors.  This version of CRITTER is sufficient
        for our needs.  The shareware sales of CRITTER have not been 
        enough to justify major enhancements.

        All users are invited to suggest enhancements.  Please contact
        the authors at the communications addresses listed below.

    Terms And Conditions
    --------------------

        You may use this software freely in any non-military environment.
        You may distribute this software freely as long as the archive
        file contains all of the files mentioned above.  This software
        (Version 1.2) expires after December 31, 1991, and will display
        a message to that effect.  Of course, the standard registered
        version is good forever.

        The following purchasing terms are available:

        Standard Registration                                   $ 20
        Latest version, disk size of your choice.

        Shareware Distribution License                          $100
        Special version for shareware authors wishing to
        distribute CRITTER with their products.  Allows
        unlimited distribution.

        Source Code in C and Assembler                          $200 *
        Includes the unusual tricks we used to get CRITTER to
        work and well-commented source code.

        Commercial Distribution License                         $300 *
        Special version for authors of commercial software,
        allows unlimited distribution.  With source code.

        And of course, if your mailing address is in Colorado,
        include sales tax (currently 7.1%).

        If you desire a site license or are a special interest
        group, contact the authors.

        * Microsoft C v6.0a and the Microsoft Macro Assembler v5.1
          are required to assemble and/or compile the source.

    Communications
    --------------

        We may be reached by the following methods for feedback:

        on GENIE        TANSTAAFL              (Dana Cline)

        on INTERNET     dcline@isis.cs.du.edu  (Dana Cline)

        on CompuServe   74606,525              (Dean McCrory)
                        73700,3053             (Dana Cline)

        by phone        (303) 989-7389 After 8 AM and before
                        10 PM MST (Thanks!).  I do have an
                        answering machine, which has an unlimited
                        message length.  I am generally not in
                        during the day (I have to work, too).

        by mail         Dana W. Cline  
                        TANSTAAFL Software
                        P. O. Box 260075
                        Lakewood, CO  80226

        Feedback of all types is appreciated.

    Disclaimer
    ----------

        The authors claim no responsibility for any damages caused by the
        use or misuse of this product.  This product is distributed "as is"
        with no warranty expressed or implied.  The authors will not be
        responsible for any losses incurred, either directly or indirectly,
        by the use or misuse of this product.  The authors reserve the
        right to make modifications at any time.  Prices are subject to
        change without notice.

    Thanks to:
    ----------

        Dean McCrory, for making CRITTER go TSR!
        Holly Miller, for much help on this manual.
        Jerry Pournelle, for continually harping about the drawbacks
            of MS-DOS.
        Floyd Pretz, for suggesting the automatic response feature.

    Information Sources:
    --------------------

        MS-DOS Programmer's Reference, from Microsoft Press
        MS-DOS Developer's Guide, from the Waite Group
        Microsoft C 5.1 Manual, from Microsoft
        MS-DOS Functions, from Microsoft Press

    Trademarks
    ----------

        Because of the nature of this manual, numerous software products are
        mentioned by their trade names.  In most, if not all, cases these
        designations are claimed as trademarks by the respective companies.
        CRITTER is not a registered trademark, but, hey, we did use it first.

                                  Order Form
                              TANSTAAFL Software


        NAME:     ______________________________________________________

        COMPANY:  ______________________________________________________

        ADDRESS:  ______________________________________________________

                  ______________________________________________________

        CITY:     ______________________________________________________

        STATE:    ________________________  ZIP CODE:  _________________

        PHONE:    ______________________________________________________

        E-MAIL ADDRESS:  _______________________________________________

        WHERE DID YOU RECEIVE CRITTER?  ________________________________

        ________________________________________________________________

        DISK SIZE NEEDED: [  ] 3-1/2      [  ] 5-1/4

        COMMENTS:  _____________________________________________________

        ________________________________________________________________

        ________________________________________________________________

        Basic Registration              @ $ 20.00             __________

        Shareware Distribution License  @ $100.00             __________

        Source Code in C and Assembler  @ $200.00             __________

        Commercial Distribution License @ $300.00             __________

        Colorado sales tax              @ 7.1 %               __________

        Non-US Shipping @ $5.00                               __________
            (Payments must be in US Dollars, US bank)

                                                    TOTAL:   $__________

        Checks or money orders only.  Cash is accepted but
        discouraged.  Absolutely no company P.O's!

        Remit to:         Dana W. Cline
                          TANSTAAFL Software
                          P.O. Box 260075
                          Lakewood, CO  80226

        Version History
        ---------------

        Version         Date            Features / Bug Fixes
        ----------------------------------------------------

        1.00            04/26/90        Original release.

        1.10            05/11/90        Automatic response and
                                        timeout feature added.

        1.20            07/20/91        Printer logging. Reduce resident
                                        size by about 700 bytes.  Use C6
                                        compiler.

        Sysops Note
        -----------

        This copy of CRITTER will refuse to run after December 31, 1991.
        Please contact TANSTAAFL software about getting a 1992 version.
