

        WatchCat 1.0

        (c) 1993 by  Felix von Normann and
                     Thomas Opheys

        program to recover OS/2 2.x from some kind of hangs
        requires a connector with a switch on a parallel port



        1. INTRODUCTION

           Although OS/2 2.x is very stable under normal circumstances, bad
           behaved or defect applications can block keyboard and mouse input
           so that the computer has to be reset. This is frustrating because
           often all processes keep on running and the operating system itself
           is ok - only the user can't input anything.
           With WatchCat, you have another input mechanism that can't be
           prevented from functioning - an external switch on the parallel
           port that can be activated when something blocks the system.
           Unless OS/2 has really crashed and the WatchCat process doesn't
           work either, you can gain back control.
           The WatchCat process runs with very high priority so that is it
           (nearly) guaranteed to become active on a regular basis. Don't
           panic... only every second, some CPU cycles are invested in
           checking a bit on the parallel port - you won't be able to
           measure any performance degradation by this.


        2. USING WatchCat

           Naturally, you have to start WatchCat BEFORE the system hangs  :-)
           It's best to put a Shadow of WATCHCAT.EXE into your Startup Folder
           or generate a new program object. You can i.e. start WatchCat hidden
           so that you don't see anything of it when you boot.
           There are several options you can enter on the command line.
           See below for detailed information.

           If you activate the switch on the parallel port, WatchCat opens
           a fullscreen window where a task list is displayed. You can
           configure this display for your own purposes, including sort
           criterium, displaying only PM programs, displaying the full path
           or just the file names, description or no description, ...

           From this screen, you can kill any process you want or open a
           fullscreen shell to do other things. Normally, OS/2 hangs are
           caused by a crashed or bad behaved application you know of.
           If you kill this app and go back to the Workplace Shell, everything
           is fine. Sometimes, the Workplace Shell itself hangs. Then it helps
           to kill the PMSHELL process. The WPS will reload automatically.
           If you have no idea what to kill, you are lost and have to try.


        3. LIMITATIONS

           WatchCat can't do wonders. If OS/2 has crashed completely or
           anything has gone too wrong, you have to reboot. But we have
           made the experience that in a lot of cases we could go on working.
           Sometimes we could gain back control and save out work before
           rebooting. And sometimes WatchCat is no help. But in this case,
           NOTHING but rebooting CAN help. If this is the case too often,
           look if something is wrong with your hardware or if you have
           installed a VERY bad driver or application.


        4. COMMAND LINE SWITCHES

           /? or /H   display a little help screen

           /C         displays several screens which describe how to build
                      a connector with a switch for the parallel port.
                      Note that this is a somewhat clumsy description, but
                      we are no experts in electrical engineereing (and this
                      wasn't really important to be) - and English isn't
                      our native language.

           /A         if you start WatchCat with this option, ALL processes
                      that exist on your system are displayed when you
                      activate the switch. The default is to display only
                      PM programs because they are the ones destined to
                      hang the message queue  :-)
                      At run-time, you can toggle anytime between the two
                      display modes.

           /P         If you start WatchCat with this switch, the processes
                      are shown with their full path name. The default is
                      that only the EXE filename is displayed. This option
                      can be changed at run-time, too.

           /I=P,B     This lets you use a non-standard parallel port or
                      another input bit. The default is to watch LPT2 for
                      a change in any of the five input bits. You COULD
                      use other hardware with i/o abilities like parallel
                      ports, too. If there is such a device responding on
                      port address 0x389 and you toggle bit 3 with your
                      switch, /I=389,3 should work. Note that the address
                      has to be hexadecimal and it is expected that a byte
                      0xFF can be WRITTEN to this address. The bit that is
                      READ has to be read from the address+1. If you use
                      LPT1 or LPT2 with the kind of connector we describe
                      below, you don't have to worry about this switch.

           /Bx        You can change the bit that is checked by WatchCat
                      with this option. Normally, all eight bits are
                      checked automatically. If this conflicts in any way
                      with other things you have connected to your parallel
                      port, you can tell WatchCat to look only for a specific
                      bit and ignore all others. x is the bit number where
                      0 is the least significant one and 7 the most significant
                      one.

           /x         With x=1 or x=2, you can tell WatchCat which LPT port
                      should be used. Default is LPT2. If you use the
                      connector on LPT2, use the switch /2.

           /T         This lets run WatchCat with time critical priority
                      for the whole time. This isn't needed normally because
                      the polling is always done with high priority. The
                      default is to switch back to regular priority when
                      WatchCat has been activated.

           /D         This switch turns off the descriptions beneath the
                      process names. This option cannot be activated or
                      reactivated at run-time, so you have to think if
                      want to see descriptions or not. The default is to
                      display them and I see no reason why this would cause
                      *major* pains  :-)

           /S:xxx     where xxx equals "type", "name" or "pid".
                      This lets you choose the initial sort order of the
                      processes. You can sort on application type, the
                      process name or the process id. Can be toggled at
                      run-time.

           /@         This is an udocumented switch for Windows NT users.
                      They are known to be using a lot of untested software
                      and undocumented features. So this option will format
                      any Windows NT partition.
                      I fear that everyone EXCEPT NT owners has understood
                      this joke  :-)



        5. THE CONNECTOR

           It's so simple... Just go out and buy a 25-pin male SUB-D
           connector that fits to your parallel port, and a switch.
           Now I have one problem: I don't know how such a switch is
           called in English: it's the kind of switches with three
           connections and that can have two states: connecting the pin
           in the middle with the pin on the left or connecting the pin
           in the middle with the pin on the right side:

              __         in this position,         __   and in this position,
              \ \        pins 1 and 2 are         / /   pins 2 and 3 are
               \ \       connected               / /    connected.
              __\_\____                      ___/_/___
             |         |                    |         |
             |_________|                    |_________|
              U   U   U                      U   U   U

              1   2   3                      1   2   3


           Connect the following pins:

           switch    connector DB-25
           ------    -----------------------------
              1   <-    2  (DATA 0 signal, output)  used as logical HIGH
              2   ->   11  (BUSY signal, input)     used to input the state
              3   <-   19  (GROUND)                 used as logical LOW



           You might also want to use another kind of switch: one that
           simply opens and closes ONE connection. It's just like the one
           that is used as a Turbo Button in your computer case. In fact,
           Felix doesn't use his Turbo Button and now uses it at the
           activation switch for WatchCat. Get a switch that stays in the
           position that you can toggle by pressing it (->Turbo Button...)
           You CAN use one like your case's Reset Button, but you might have
           to hold it down for a while before WatchCat recognizes it.
           You also need one 4.7 kOhm resistor if you want to use such a
           switch:

             _________
            |---------|   In this state,            ________     In this state,
           _|_________|_  pins 1 and 2            _|________|_   when pressed,
           |           |  are NOT                |            |  pins 1 and 2
           |___________|  connected.             |____________|  are connected.
              U     U                               U     U

              1     2                               1     2


           Connect one end of the resistor with pin 11, the other end with
           pin 19 of the parallel port connector. Pin 11 is also connected
           to one pin of the switch. The other pin of the switch is connected
           to pin 2 of the parallel port.

           I hope everyone can understand what I wanted to say. See the
           README.BMP picture for a little more detailed graphical
           representation.

