Watchdog Timer Interfaces For The Linux Operating System
|
Watchdog Timer Interfaces For The Linux Operating System
|
|
|
Alan Cox
|
Alan Cox
|
|
|
Custom Linux Driver And Program Development
|
Custom Linux Driver And Program Development
|
|
|
|
|
The following watchdog drivers are currently implemented:
|
The following watchdog drivers are currently implemented:
|
|
|
ICS WDT501-P
|
ICS WDT501-P
|
ICS WDT501-P (no fan tachometer)
|
ICS WDT501-P (no fan tachometer)
|
ICS WDT500-P
|
ICS WDT500-P
|
Software Only
|
Software Only
|
|
|
All four interfaces provide /dev/watchdog, which when open must be written
|
All four interfaces provide /dev/watchdog, which when open must be written
|
to within a minute or the machine will reboot. Each write delays the reboot
|
to within a minute or the machine will reboot. Each write delays the reboot
|
time another minute. In the case of the software watchdog the ability to
|
time another minute. In the case of the software watchdog the ability to
|
reboot will depend on the state of the machines and interrupts. The hardware
|
reboot will depend on the state of the machines and interrupts. The hardware
|
boards physically pull the machine down off their own onboard timers and
|
boards physically pull the machine down off their own onboard timers and
|
will reboot from almost anything.
|
will reboot from almost anything.
|
|
|
A second temperature monitoring interface is available on the WDT501P cards
|
A second temperature monitoring interface is available on the WDT501P cards
|
and provides /dev/temperature. This is the machine internal temperature in
|
and provides /dev/temperature. This is the machine internal temperature in
|
degrees farenheit. Each read returns a single byte giving the temperature.
|
degrees farenheit. Each read returns a single byte giving the temperature.
|
|
|
The third interface logs kernel messages on additional alert events.
|
The third interface logs kernel messages on additional alert events.
|
|
|
Both software and hardware watchdog drivers are available in the standard
|
Both software and hardware watchdog drivers are available in the standard
|
kernel. If you are using the software watchdog, you probably also want
|
kernel. If you are using the software watchdog, you probably also want
|
to use "panic=60" as a boot argument as well.
|
to use "panic=60" as a boot argument as well.
|
|
|
Features
|
Features
|
--------
|
--------
|
WDT501P WDT500P Software
|
WDT501P WDT500P Software
|
Reboot Timer X X X
|
Reboot Timer X X X
|
External Reboot X X o
|
External Reboot X X o
|
Temperature X o o
|
Temperature X o o
|
Fan Speed X o o
|
Fan Speed X o o
|
Power Under X o o
|
Power Under X o o
|
Power Over X o o
|
Power Over X o o
|
Overheat X o o
|
Overheat X o o
|
|
|
The external event interfaces on the WDT boards are not currently supported.
|
The external event interfaces on the WDT boards are not currently supported.
|
Minor numbers are however allocated for it.
|
Minor numbers are however allocated for it.
|
|
|
|
|
Example Watchdog Driver
|
Example Watchdog Driver
|
-----------------------
|
-----------------------
|
|
|
#include
|
#include
|
#include
|
#include
|
#include
|
#include
|
|
|
int main(int argc, const char *argv[])
|
int main(int argc, const char *argv[])
|
{
|
{
|
int fd=open("/dev/watchdog",O_WRONLY);
|
int fd=open("/dev/watchdog",O_WRONLY);
|
if(fd==-1)
|
if(fd==-1)
|
{
|
{
|
perror("watchdog");
|
perror("watchdog");
|
exit(1);
|
exit(1);
|
}
|
}
|
while(1)
|
while(1)
|
{
|
{
|
write(fd,"\0",1);
|
write(fd,"\0",1);
|
sleep(10);
|
sleep(10);
|
}
|
}
|
}
|
}
|
|
|
|
|
Contact Information
|
Contact Information
|
|
|
People keep asking about the WDT watchdog timer hardware: The phone contacts
|
People keep asking about the WDT watchdog timer hardware: The phone contacts
|
for Industrial Computer Source are:
|
for Industrial Computer Source are:
|
|
|
US: 619 677 0877 (sales) 0895 (fax)
|
US: 619 677 0877 (sales) 0895 (fax)
|
UK: 01243 533900
|
UK: 01243 533900
|
France (1) 69.18.74.30
|
France (1) 69.18.74.30
|
|
|
Industrial Computer Source
|
Industrial Computer Source
|
9950 Barnes Canyon Road
|
9950 Barnes Canyon Road
|
San Diego, CA
|
San Diego, CA
|
|
|
and please mention Linux when enquiring.
|
and please mention Linux when enquiring.
|
|
|