home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
WATDG121.ZIP
/
WATCHDOG.DOC
< prev
Wrap
Text File
|
1992-10-31
|
19KB
|
506 lines
WatchDog v.1.21
(c) 1992 Ernest Vogelsinger (ASP)
Index
-----
Package Contents . . . . . . . . . . . . . . . . . 1
General Description . . . . . . . . . . . . . . . 1
Main Features of WatchDog . . . . . . . . . . . . 2
How to use WatchDog . . . . . . . . . . . . . . . 2
WatchDog Command Line . . . . . . . . . . . . . . 4
Built-In Default Values . . . . . . . . . . . . . 6
The Multiplexer Interface . . . . . . . . . . . . 6
Booting The Machine . . . . . . . . . . . . . . . 6
Modem Hang Up . . . . . . . . . . . . . . . . . . 7
Delayed Boot . . . . . . . . . . . . . . . . . . . 7
The Legal Department . . . . . . . . . . . . . . . 7
Zero-Registration Shareware, Distribution Policy . 8
WatchDog Source Code . . . . . . . . . . . . . . . 8
Contacting The Author . . . . . . . . . . . . . . 8
ASP Ombudsman Statement . . . . . . . . . . . . . 8
Package Contents
----------------
The WTCHDG.ZIP archive contains the following files:
o WATCHDOG.COM the WatchDog program
o READ.ME you're currently reading this file, thank you!
o FILE_ID.DIZ description for automatic extraction by BBS'es
o DESC.SDI description for automatic extraction by BBS'es
o ASP.DOC ASP Ombudsman Statement
General Description
-------------------
WatchDog is a resident utility program monitoring the activity status of
a COM port (carrier) and DOS (Dos and Kbd calls).
Its main use is with remote BBS software that hands control to e.g. a
shell program. When the shell program hangs (Dos watch) or carrier loss
is detected (COM watch) the serial port DTR is dropped (hangup) and the
machine is rebooted.
VERSION 1.20
By popular demand, a ring count watch has been added. This is to allow
reboot when the BBS program fails to go off-hook, by what reason ever.
The ring watch can be customized to any needed ring count and can also
be disabled.
After a certain time without a ring indicated by the modem, WatchDog will
assume ringing has stopped, and reset the ring counter. This no-ring time
can also be customized.
VERSION 1.21
The ability to specify a custom COM port address has been added to
support non-DOS serial ports.
The /NORing default value (see below) has been set to 8 seconds.
----- WatchDog ---------------------------------------------- Page 1 of 8 ---
Main Features of WatchDog
-------------------------
o Needs only 800 bytes of memory.
o Can be activated, deactivated, and reconfigured as often as needed,
and it can also be unloaded.
o Monitoring is lightning fast so no data loss should occur with
high speed serial communications.
o Detects carrier loss by monitoring COM 1, 2, 3 or 4, or on a
user-defined port address.
The COM port can be selected from the command line, or carrier monitor
can be completely switched off.
o Built-in ring counter to reboot when the BBS fails to go off-hook.
Reboot counter can freely be specified or disabled.
o Detects a hanging program by monitoring "DOS" activity.
WatchDog accepts Int16 (keyboard), Int21 (DOS), and Int28 (DOS Idle)
as "DOS" activity. The "DOS" timeout seconds can be selected from the
command line, or "DOS" monitoring can be completely switched off.
o The reboot method can be selected from "Bios" (the usual jump to
bios location FFFF:0), and "Hardware", where the CPU is rebooted
via a command to the keyboard controller. This is often necessary with
protected mode DOS extenders.
o Reboot can be delayed to allow lazy write cache programs write their
data back. The delay time can be selected from the command line.
WatchDog can be tailored to meet individual requirements with command
line arguments. It may be executed multiple times, without being
reloaded. A secondary copy always modifies the settings of the resident
watchdog.
How to use WatchDog
-------------------
Most BBS software is started through a batch file. Assume the following
batch file (used to start the WildCat! BBS):
REM ----- WILDCAT BBS BATCH FILE -----
@echo off
:reload
cd \wildcat
wildcat
if errorlevel 50 goto door
if errorlevel 41 goto reload
if errorlevel 40 goto dropdos
if errorlevel 2 goto event_a
if errorlevel 1 goto reload
goto end
:door
call door
goto reload
:dropdos
call dropdos
goto reload
----- WatchDog ---------------------------------------------- Page 2 of 8 ---
:event_a
call online_game
goto reload
:end
REM ----- END WILDCAT BBS BATCH FILE -----
While the BBS software is monitoring for carrier loss, doors, DOS shell,
and other miscellaneous programs (e.g. the game batch as above) can't.
Thus, if the caller hangs up while in a DOS shell, a door not supporting
carrier monitor, or in another program (e.g. online games), the BBS
software would never get control again, and couldn't service the next
caller.
This is where WatchDog comes in. In all cases mentioned above you would
want to reboot the BBS computer, since your AUTOEXEC batch will reload
the BBS software. On the other hand, it should NOT reboot if the BBS
program is active, or when no carrier is to be expected (e.g. when
starting or leaving the BBS batch file).
Here comes the same batch file again. WatchDog commands are added to
explain how to use it.
REM ----- WILDCAT BBS BATCH FILE -----
@echo off
REM First time execution will load WatchDog resident
REM Parameters:
REM COM=2 The modem is connected to COM2
REM
REM Keep the defaults for all other settings
REM (see below for default values)
watchdog /com=2
:reload
REM Since the batch file loop will enter here again, we need to
REM switch carrier monitoring off before (re)entering the BBS
REM Parameters
REM CARRIER=OFF Switch off carrier monitor
REM QUIET Suppress copyright message
watchdog /carrier=off /quiet
cd \wildcat
wildcat
if errorlevel 50 goto door
if errorlevel 41 goto reload
if errorlevel 40 goto dropdos
if errorlevel 2 goto event_a
if errorlevel 1 goto reload
goto end
:door
REM Let's assume the door program can't handle carrier detection
REM so we need to activate the carrier monitoring feature of WatchDog
REM before calling the door batch file
watchdog /carrier=on /quiet
call door
----- WatchDog ---------------------------------------------- Page 3 of 8 ---
goto reload
:dropdos
REM before dropping to DOS we need to activate carrier monitor
watchdog /carrier=on /quiet
call dropdos
goto reload
:event_a
REM before entering the online game activate carrier monitor
watchdog /carrier=on /quiet
call online_game
goto reload
:end
REM WildCat exits normally, so we unload the WatchDog TSR
watchdog /unload
REM ----- END WILDCAT BBS BATCH FILE -----
WatchDog Command Line
---------------------
You load (and reconfigure) WatchDog by specifying
WATCHDOG [/option=value] ...
on the command line, or in a batch file.
WatchDog recognizes the following parameters:
/COM=n
n - A value between 0 and 4, specifying the COM port to monitor.
Specifying 0, or a non-existent port, will disable
carrier monitoring and ring counting.
NOTE: different to version 1.11, the /COM parameter doesn't
enable or disable carrier watch, since the ring count
feature has been added. To enable or disable carrier
monitoring, use the following parameter.
** 1.21 NEW **
/PORT=hhhh
hhhh - A hexadecimal value specifying the COM port address.
If the COM port is on a nonstandard address (and therefore not
available as COM1-COM4) you can define the actual port address
to use.
/CARRIER=ss
ss - A string specifying carrier monitoring activity. You may specify
ON - enable carrier monitor
OFF - disable arrier monitor
/DOS=nn
nn - A value between 0 and 65535, specifying the number of seconds
that DOS may be inactive before WatchDog reboots.
Specifying 0 will disable DOS monitoring.
----- WatchDog ---------------------------------------------- Page 4 of 8 ---
/RING=nn
nn - A value between 0 and 65535, specifying the number of rings that
will be allowed for rebooting.
Specifying 0 will disable the ring monitor.
NOTE: if the modem is online (carrier active), the ring monitor
is automatically disabled, regardless of the carrier
monitor status.
/NORING=nn
nn - A value between 0 and 65535. After this time is elapsed without
a ring to occur, WatchDog determines that ringing has stopped,
and resets the ring counter.
/MPX=xx
xx - A (hexadecimal) value between C0 and FF, specifying the ID byte
for the Multiplexer communication (see note on MPX below).
The default value is C0, or the first free ID byte found.
/BOOT=ss
ss - A string specifying the boot method. You may specify
BIOS - boot by passing control to the bios location FFFF:0
HARDWARE - boot by resetting the CPU via keyboard controller
or HW (see note on booting below).
/WAIT=nn
nn - A value between 0 and 65535, specifying the number of seconds
that WatchDog will wait for DOS to become idle before rebooting
(see note on delayed boot below).
/DELAY=nn
nn - A value between 0 and 65535, specifying the number of seconds
that WatchDog will delay before rebooting (see note on delayed
boot below).
/WATCH=ss
ss - A string specifying WatchDog activity. You may specify
ON - enable WatchDog
OFF - disable WatchDog
This en- and disables the overall WatchDog activity. If either
carrier detect or DOS monitor is disabled, specifying ON will
not change these values.
/UNLOAD
Unloads the resident WatchDog if possible. If another program
has hooked one of the interrupts WatchDog uses, it will display
a message and disable itself.
/STATUS
Displays the current WatchDog status.
/?, /HELP
Displays a descriptive help text.
/DEFAULT
Displays the built-in default values.
/QUIET
Suppresses all output messages.
----- WatchDog ---------------------------------------------- Page 5 of 8 ---
Built-In Default Values
-----------------------
COM = COM1
PORT = Dos value for COM1 (usually 3F8h)
DOS = 60 1 minute allowed for DOS inactivity
CARRIER = OFF initially disabled since carrier is usually off
at loading time
RING = 6 reboot after 6 rings without going offhook
NORING = 8 after 8 seconds without incoming ring it is assumed
that ringing has stopped
MPX = C0 see "Multiplexer Interface" below
BOOT = BIOS see "Booting the Machine" below
WAIT = 5 Wait 5 seconds for DOS to become available
DELAY = 5 Delay 5 seconds before booting
WATCH = ON Activate watchdog
The Multiplexer Interface
-------------------------
The Multiplexer interrupt (Int2F) is a mechanism for programs to communicate.
WatchDog uses this mechanism to communicate between the transient program
(the loader) and the (smaller) part that stays resident in memory.
The defined interface protocol is very simple. An ID byte is specified in
the AH register, and the function code is put in the AL register. Then the
interrupt is called. The ID bytes C0 .. FF are reserved for "user programs".
WatchDog tries to find a free ID value between C0 and FF and will use this.
Sometimes it is necessary to avoid certain ID values to allow other programs
that do not scan for a free byte to run. This is the reason why the Mpx ID
can be specified on the command line. Usually you will not need to change
this.
Booting The Machine
-------------------
Generally, there are two ways to reboot a (DOS) computer via software. The
method used most is to pass control to the code at FFFF:0. While this works
in most cases where "DOS only" is loaded, it might cause problems with
certain types of protected mode DOS extender software. The machine might
endlessly hang, and not reboot. One example I personally know is Soft-ICE,
a protected mode debugger software. I have heard rumours that QEMM or EMM386
might react similar in some cases.
If you encounter that problem, add /BOOT=HW to the command line to enable
hardware CPU reset.
WatchDog resets the CPU by sending a special command to the keyboard
controller. The keyboard controller (port 64h) understands a lot of commands.
The command we need here is Fx, that pulses bits of the output port low
for 6 µs. Bits 0-3 of command indicate which bits should be pulsed:
0=pulse, 1=don't pulse. Pulsing bit 0 (command FE) results in CPU reset
since it is connected to system reset line.
There are some PS/2 computers where this method will not work (I believe
it's PS/2 model 80).
----- WatchDog ---------------------------------------------- Page 6 of 8 ---
Modem Hang Up
-------------
If a COM port is specified, and WatchDog is about to reboot, it drops
the DTR (Data Terminal Ready) and RTS (Ready To Send) lines on the modem,
causing the modem to hang up and the serial port to be reset.
While this might not be necessary with carrier loss, it is a must if reboot
is caused by DOS timeout.
Delayed Boot
------------
A very special feature is WatchDogs Delayed Boot opportunity.
Whenever you're using a lazy-write cache program (like SMARTDRV etc) you'll
loose data when rebooting, if the cache software couldn't finish writing
your data back.
The first thing WatchDog does after resetting the modem is to wait for DOS
to become available. Since the cache software needs DOS to write the data
to disk, it will not do disk writes if DOS is busy. The time how long
WatchDog should wait for DOS to become available is specified with the
/WAIT=nn command line parameter.
After DOS is available, WatchDog waits for the time specified in the
/DELAY=nn parameter. While waiting, it repeatedly issues Int28, thus
pretending that DOS is idle on the command line.
Both actions together (wait for DOS to become available, and then loop for
a couple of seconds) allows lazy write caches to finish their write activity.
However, if DOS will not become available (e.g. if some DOS structure has
been corrupted, and DOS itself is hanging), WatchDog will reboot the machine
without being able to give time to background programs. In these cases,
data loss will occur and cannot be avoided.
The Legal Department
--------------------
Users of WatchDog must accept the following disclaimer of warranty:
THIS COPYRIGHTED SOFTWARE AND ITS DOCUMENTATION IS PROVIDED ON AN "AS IS"
BASIS. THE AUTHOR MAKES NO WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY AND/OR
FITNESS FOR A PARTICULAR PURPOSE.
THE USER ASSUMES ALL RISKS OF THE USE OF THIS SOFTWARE. THE AUTHOR ASSUMES
NO LIABILITY FOR DAMAGES, DIRECT OR CONSEQUENTIAL, WHICH MAY RESULT FROM THE
USE OR MISUSE OF WATCHDOG.
As it cannot be guaranteed that loss of data will not occur, WatchDog should
be tested with non-critical data. As always, judicious backups are a wise
and necessary continuing precaution.
----- WatchDog ---------------------------------------------- Page 7 of 8 ---
Zero-Registration Shareware, Distribution Policy
------------------------------------------------
Now that the necessary legal issues are out of the way:
WatchDog is a program I wrote because I was missing a lot of features in
the watchdog program I have got (it was written in '84, and therefore
heavily aged out).
WatchDog v.1.21 is "zero-registration" shareware. that means, you may use it
freely, without notifying me or anyone else, and without paying one cent. I
sincerely hope it will satisfy you.
You may freely distribute WatchDog, as long as the archive file remains
unmodified. I expressly forbid to add any files, or any comments to the
archive.
WatchDog Source Code
--------------------
The source code for WatchDog can be obtained by contacting me at the
CompuServe address mentioned below. The fee for the source code is
US$ 150.--. For more information, please contact me.
Contacting The Author
---------------------
If you have questions or ideas for future enhancements of WatchDog, I'd be
glad if you would contact me via CompuServe. Of course, I'll be happy if you
just want to tell me the program works well.
Ernest Vogelsinger
CIS 100015,551
ASP Ombudsman Statement
-----------------------
This program is produced by a member of the Association
of Shareware Professionals (ASP). ASP wants to make sure
that the shareware principle works for you. If you are
unable to resolve a shareware-related problem with an ASP
member by contacting the member directly, ASP may be able
to help. The ASP Ombudsman can help you resolve a dispute
or problem with an ASP member, but does not provide
technical support for members' products. Please write to
The ASP Ombudsman
545 Grover Road, Muskegon
MI 49442-9427
or send a Compuserve message via CompuServe Mail to
ASP Ombudsman 70007,3536
----- WatchDog ---------------------------------------------- Page 8 of 8 ---