7

I have an embedded computer I am trying to develop on and I wanted to know if the watchdog it has is a software watchdog or if it is a hardware watchdog.

First I checked and I saw that /dev/watchdog is present inside /dev. But I did not see a watchdog process when I issued ps. So I installed a watchdog daemon (or driver?) and verified that a watchdog is running, again I used ps.

My problem now is I have no idea whether this is a hardware or software watchdog... there is a .conf file and also a process called /usr/sbin/watchdog owned by root. In case that info helps.

TIA!

Niko


The dmidecode does NOT show the watchdog information on this machine, whereas it does show watchdog present info on my peer's laptop:

On the other hand on my computer the /dev folder is NOT showing the watchdog entry nor does lsmod|grep softdog show anything.

From here: http://www.sat.dundee.ac.uk/psc/watchdog/watchdog-testing.html

Checking for the Watchdog Hardware If you have successfully loaded the watchdog hardware's driver module (or the 'softdog' > emulator) then you should see the entry in /dev corresponding to this. For example:

ls -l /dev/watch*
crw------- 1 root root 10, 130 May 13 16:27 /dev/watchdog

I need to know which module do I need to load for hardware watchdog and for that I need to know what module does my hardware watchdog require!

One board I have is: CAPA830 with Ubuntu 12.04 on it
and other is:
3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

dmesg on the second machine shows:
NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.

Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
nemo
  • 593
  • 2
  • 8
  • 22
  • @TheIndependentAquarius What kind of processor(s) does your platform have? Often there will be a datasheet available for you to reference registers that would configure a HW watchdog. – Peter L. Aug 07 '14 at 17:02
  • @PeterL. uname -a says: `3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux` on one manchine, and other is this: http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBsQFjAA&url=http%3A%2F%2Fwww.hectronic.se%2Fwebsite1%2F%2F50.0.1.0%2F423%2Fdownload_2259.php&ei=913kU_i2AY_c8AW5uILQBw&usg=AFQjCNFSUhdyuMPgDut_Y0s9-X7HAkhaYQ&sig2=q1uHhZuPlS6WI98DWFN3Ag&bvm=bv.72676100,d.dGc – Aquarius_Girl Aug 08 '14 at 05:21
  • 1
    @TheIndependentAquarius If this is based on the Atom processor, it looks like the HW watchdog is configured via the x86 ioport addresses 0x2E /0x2F. You can write a little code to see if it is configured on your platform. See the sample assembly code on page 72 of that PDF. You can simply disable the HW watchdog and see if it still fires to determine if SW watchdog is enabled. – Peter L. Aug 08 '14 at 17:45

2 Answers2

5

If you are talking about Linux's software watchdog then softdog module should be loaded, which you can verify with

$lsmod|grep softdog
softdog                13319  0 
auselen
  • 27,577
  • 7
  • 73
  • 114
5

Only one watchdog could be present per system. That could be either a software watchdog or a hardware watchdog. Generally when a watchdog(software/hardware) is inserted, the kernel creates a device node as /dev/watchdog. You can check if the file is present or not. If yes, watchdog is active on your machine, else not.

Now, the /usr/bin/watchdog that your were referring to is a watchdog daemon. It runs in the background and continuously reports the system status to the watchdog(either implemented as hardware/software).

For more info on the daemon, please refer to the man page of watchdog man watchdog.

To check if it is a hardware/software watchdog, just do :

$ lmsmod | grep softdog

If you get an output, your system is running a software watchdog, else a hardware watchdog is implanted into the system. This check is to be done, provided, that you have a node named /dev/watchdog present.

Hope this helps.

raghav3276
  • 1,088
  • 8
  • 14