watchdog timer

Linux can make use of a hardware watchdog timer to allow a system to
force a hard reboot or shutdown if it becomes unresponsive. Does Windows
have such a thing? Google tells me that it exists for embedded windows
but I can’t see anything in the WDK for normal server/workstation OS’s,
but it wouldn’t be the first time that Windows and Linux have different
names for the same thing so maybe I’m just not using the right
keywords…

There is work to create a ‘virtual watchdog’ timer under Xen to allow
Xen to automatically reboot a VM if it should stop responding, and it
would useful to implement that functionality into my Windows drivers if
possible.

Thanks

James

>

Linux can make use of a hardware watchdog timer to allow a system to
force a hard reboot or shutdown if it becomes unresponsive. Does
Windows
have such a thing? Google tells me that it exists for embedded windows
but I can’t see anything in the WDK for normal server/workstation
OS’s,
but it wouldn’t be the first time that Windows and Linux have
different
names for the same thing so maybe I’m just not using the right
keywords…

There is work to create a ‘virtual watchdog’ timer under Xen to allow
Xen to automatically reboot a VM if it should stop responding, and it
would useful to implement that functionality into my Windows drivers
if
possible.

And before anyone points it out, yes I could just write it all myself,
but Linux has a framework for managing it all, including the necessary
steps to handle shutdown without triggering the watchdog etc, so I’m
asking if Windows has the same sort of framework.

Thanks

James

There is some watchdog.sys in Windows since I think XP, possibly undocumented.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

“James Harper” wrote in message news:xxxxx@ntdev…
Linux can make use of a hardware watchdog timer to allow a system to
force a hard reboot or shutdown if it becomes unresponsive. Does Windows
have such a thing? Google tells me that it exists for embedded windows
but I can’t see anything in the WDK for normal server/workstation OS’s,
but it wouldn’t be the first time that Windows and Linux have different
names for the same thing so maybe I’m just not using the right
keywords…

There is work to create a ‘virtual watchdog’ timer under Xen to allow
Xen to automatically reboot a VM if it should stop responding, and it
would useful to implement that functionality into my Windows drivers if
possible.

Thanks

James

If any clock interrupt is missed on a MP system or a DPC routine executes
for too long you can get an infamous 0x101 bug check. Also look here:
http://msdn.microsoft.com/en-us/library/ff553005(v=vs.85).aspx

//Daniel

“James Harper” wrote in message
news:xxxxx@ntdev…
Linux can make use of a hardware watchdog timer to allow a system to
force a hard reboot or shutdown if it becomes unresponsive. Does Windows
have such a thing? Google tells me that it exists for embedded windows
but I can’t see anything in the WDK for normal server/workstation OS’s,
but it wouldn’t be the first time that Windows and Linux have different
names for the same thing so maybe I’m just not using the right
keywords…

There is work to create a ‘virtual watchdog’ timer under Xen to allow
Xen to automatically reboot a VM if it should stop responding, and it
would useful to implement that functionality into my Windows drivers if
possible.

Thanks

James

>

If any clock interrupt is missed on a MP system or a DPC routine
executes
for too long you can get an infamous 0x101 bug check. Also look here:
http://msdn.microsoft.com/en-us/library/ff553005(v=vs.85).aspx

Yes that’s useful, but isn’t what I wanted.

James

//Daniel

“James Harper” wrote in message
> news:xxxxx@ntdev…
> Linux can make use of a hardware watchdog timer to allow a system to
> force a hard reboot or shutdown if it becomes unresponsive. Does
Windows
> have such a thing? Google tells me that it exists for embedded windows
> but I can’t see anything in the WDK for normal server/workstation
OS’s,
> but it wouldn’t be the first time that Windows and Linux have
different
> names for the same thing so maybe I’m just not using the right
> keywords…
>
> There is work to create a ‘virtual watchdog’ timer under Xen to allow
> Xen to automatically reboot a VM if it should stop responding, and it
> would useful to implement that functionality into my Windows drivers
if
> possible.
>
> Thanks
>
> James
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

James,

The IIRC correctly the standard driver for Windows is blisteringly simple
and was provided for embedded as a convenience to folks ‘assembling’ EW
systems from standard components.

It think it took me about an hour total to have a fully functional KMDF
based driver for the Intel 25AB device.

One WDFTIMER to tickle the Watchdog and keep it happy and an DPCForISR to do
the same.

What sort of ‘services’ are you looking for from the OS?

I mean, the only thing you can do is turn it on or off and that is typically
a BIOS function.

It was largely ripping off KMDF sample code (thanks) and reading the
datasheet to figure out what register to whack. Since I assume this is a
‘virtual watchdog’ you won’t be scratching your head reading an obtuse
datasheet so hey, 45 mins tops :slight_smile:

I truly can understand why MSFT did not agonize over a ‘framework’ for
supporting watchdog timers. You got a motherboard with a WDT in the
chipset? The vendor that created the chipset can give you a driver for it.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of James Harper
Sent: Thursday, April 14, 2011 1:21 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] watchdog timer

Linux can make use of a hardware watchdog timer to allow a system to
force a hard reboot or shutdown if it becomes unresponsive. Does
Windows
have such a thing? Google tells me that it exists for embedded windows
but I can’t see anything in the WDK for normal server/workstation
OS’s,
but it wouldn’t be the first time that Windows and Linux have
different
names for the same thing so maybe I’m just not using the right
keywords…

There is work to create a ‘virtual watchdog’ timer under Xen to allow
Xen to automatically reboot a VM if it should stop responding, and it
would useful to implement that functionality into my Windows drivers
if
possible.

And before anyone points it out, yes I could just write it all myself,
but Linux has a framework for managing it all, including the necessary
steps to handle shutdown without triggering the watchdog etc, so I’m
asking if Windows has the same sort of framework.

Thanks

James


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

>

James,

The IIRC correctly the standard driver for Windows is blisteringly
simple
and was provided for embedded as a convenience to folks ‘assembling’
EW
systems from standard components.

It think it took me about an hour total to have a fully functional
KMDF
based driver for the Intel 25AB device.

One WDFTIMER to tickle the Watchdog and keep it happy and an DPCForISR
to do
the same.

What sort of ‘services’ are you looking for from the OS?

I mean, the only thing you can do is turn it on or off and that is
typically
a BIOS function.

It was largely ripping off KMDF sample code (thanks) and reading the
datasheet to figure out what register to whack. Since I assume this
is a
‘virtual watchdog’ you won’t be scratching your head reading an obtuse
datasheet so hey, 45 mins tops :slight_smile:

I truly can understand why MSFT did not agonize over a ‘framework’ for
supporting watchdog timers. You got a motherboard with a WDT in the
chipset? The vendor that created the chipset can give you a driver
for it.

It’s partly just philosophy. Under Linux you have a kernel driver which
is chipset specific (or ‘softdog’ for the software only version if you
don’t have anything onboard), and then a standard usermode app that
pokes the driver periodically so the timer doesn’t run down. The
usermode process recycles itself regularly (to make sure process
creation is still okay I think, but possibly for other reasons), writes
files to disk (to make sure IO hasn’t hung), and can do a few other
tasks, the failure of which will cause it to stop poking the driver and
allow the timer to run down and the system to reboot.

The advantage of the single usermode app is that it gives a uniform set
of features no matter what the underlying hardware. Windows internalises
a lot of the things that are covered here so I guess it’s just a matter
of the right solution for the problem. On a desktop system it would be
acceptable to let the user initiate the reboot on a hung system. On a
server that’s not necessarily what you’d want.

We had a HP server fail just recently with disk timeouts and then an
eventual hang, and after 30 minutes it hadn’t rebooted or anything, I
had to do it manually. A usermode app poking a kernel mode watchdog
would have caught this. A pure kernel mode ‘poker’ (which I think is
what the ASR controller is supposed to do) might not have.

James

James,

Thanks for the education (really!). I had not considered the idea that the
‘hang’ could be purely above the kernel but that surely makes sense. A
standardized set of policies / UM detection facilities with a IOCTL to the
WDT driver to tell it ‘it all looks good up here in UM’ makes sense.

That seems like a natural extension to a WDT driver to expose a device
interface that supports UM tickle.

But alas, it looks like you will have to build it all none the less.

Cheers,
Dave Cattley