Import 2.4.0-test2pre7
[davej-history.git] / Documentation / watchdog.txt
blob893ead8a8bda922b8a4445a54d543a0ee963c26a
1         Watchdog Timer Interfaces For The Linux Operating System
3                 Alan Cox <alan@lxorguk.ukuu.org.uk>
5              Custom Linux Driver And Program Development
8 The following watchdog drivers are currently implemented:
10         ICS     WDT501-P
11         ICS     WDT501-P (no fan tachometer)
12         ICS     WDT500-P
13         Software Only
14         Berkshire Products PC Watchdog Revision A & C (by Ken Hollis)
17 All five interfaces provide /dev/watchdog, which when open must be written
18 to within a timeout or the machine will reboot. Each write delays the reboot
19 time another timeout. In the case of the software watchdog the ability to 
20 reboot will depend on the state of the machines and interrupts. The hardware
21 boards physically pull the machine down off their own onboard timers and
22 will reboot from almost anything.
24 A second temperature monitoring interface is available on the WDT501P cards
25 and some Berkshire cards. This provides /dev/temperature. This is the machine 
26 internal temperature in degrees Fahrenheit. Each read returns a single byte 
27 giving the temperature.
29 The third interface logs kernel messages on additional alert events.
31 Both software and hardware watchdog drivers are available in the standard
32 kernel. If you are using the software watchdog, you probably also want
33 to use "panic=60" as a boot argument as well.
35 The wdt card cannot be safely probed for. Instead you need to pass
36 wdt=ioaddr,irq as a boot parameter - eg "wdt=0x240,11".
38 Features
39 --------
40                 WDT501P         WDT500P         Software        Berkshire
41 Reboot Timer       X               X                X               X
42 External Reboot    X               X                o               o
43 I/O Port Monitor   o               o                o               X
44 Temperature        X               o                o               X
45 Fan Speed          X               o                o               o
46 Power Under        X               o                o               o
47 Power Over         X               o                o               o
48 Overheat           X               o                o               o
50 The external event interfaces on the WDT boards are not currently supported.
51 Minor numbers are however allocated for it.
54 Example Watchdog Driver
55 -----------------------
57 #include <stdio.h>
58 #include <unistd.h>
59 #include <fcntl.h>
61 int main(int argc, const char *argv[])
63         int fd=open("/dev/watchdog",O_WRONLY);
64         if(fd==-1)
65         {
66                 perror("watchdog");
67                 exit(1);
68         }
69         while(1)
70         {
71                 write(fd,"\0",1);
72                 sleep(10);
73         }
77 Contact Information
79 People keep asking about the WDT watchdog timer hardware: The phone contacts
80 for Industrial Computer Source are:
82 Industrial Computer Source
83 http://www.indcompsrc.com
84 ICS Advent, San Diego
85 6260 Sequence Dr.
86 San Diego, CA 92121-4371
87 Phone (858) 677-0877
88 FAX: (858) 677-0895
90 ICS Advent Europe, UK
91 Oving Road
92 Chichester,
93 West Sussex,
94 PO19 4ET, UK
95 Phone: 00.44.1243.533900
98 and please mention Linux when enquiring.
100 For full information about the PCWD cards see the pcwd-watchdog.txt document.