LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Hardware watchdog in BIOS and Linux watchdog driver are different? (http://www.linuxquestions.org/questions/linux-hardware-18/hardware-watchdog-in-bios-and-linux-watchdog-driver-are-different-381289/)

travishein 11-08-2005 09:44 PM

Hardware watchdog in BIOS and Linux watchdog driver are different?
 
When I compile my kernel with watchdog support, and create /dev/watchdog as
mknod /dev/watchdog c 10 130
and use the the example watchdog driver code snippet from the Kernel documentation (below)
The watchdog works beautifully, in that when the user watchdog daemon terminates, the sytsem will reboot within 1 minute.

In the BIOS, there is also a setting that has watchdog enable / disable. My motherboard manual said when this is enabled, the system will reboot after 5 minutes of inactivity.
I would like to enable the BIOS watchdog as well, since sometimes the system will crash as it is first booting up, i.e. somewhere after lilo, but somewhere before the disks are mounted.

However, currently, when I enable the BIOS watchdog feature, and use my Linux watchdog driver and monitor program, The system still is rebooting on 5 minute intervals.
(The Linux driver watchdog will work when bios watchdog is enabled or disabled).

So, my first thought was the bios enabled watchdog must require kicking in a way that is different from how the Linux driver enabled watch dog mode does ?

Could we have a user-land program manage both the linux driver to hardware watchdog and the Bios configured watchdog (i.e. are there any better watchdog kicking programs out there?)
Or is it possible the system just has two different watchdog hardware and I am not accessing the right device for the bios watchdog?

I am using a Supermicro P4DP8-G2 mainboard. Using Linux 2.6.13 kernel, and currently the w83627hf watchdog driver. (what the manual sais I have)


Example Watchdog Driver that is in Kernel documentation (what I am currently using)
-----------------------

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, const char *argv[])
{
int fd=open("/dev/watchdog",O_WRONLY);
if(fd==-1)
{
perror("watchdog");
exit(1);
}
while(1)
{
write(fd,"\0",1);
fsync(fd);
sleep(10);
}
}

sunnyup 12-22-2008 10:41 PM

Linux watchdog is a software daemon
 
Linux watchdog is a software daemon, and it doesn't run like a hardware watchdog does. Software watchdog still need a timer or other device like interrupt system, but it runs on the software layer.
Why not refer to this for a clear answer:
Watchdog—The Linux Software Daemon


All times are GMT -5. The time now is 10:10 PM.