Chapter 13: Watchdog Device Drivers
A watchdog is a hardware (sometimes emulated by software) device intended to ensure the availability of a given system. It helps make sure that the system always reboots upon a critical hang, thus allowing to monitor the "normal" behavior of the system.
Whether it is hardware-based or emulated by software, the watchdog is, most of the time, nothing but a timer initialized with a reasonable timeout that should be periodically refreshed by software running on the monitored system. If for any reason the software stops/fails at refreshing the timer (and has not explicitly shut it down) before it expires (it runs to timeout), this will trigger a (hardware) reset of the whole system (the computer, in our case). Such a mechanism can even help with recovering from a kernel panic. By the end of this chapter, you will be able to do the following:
- Read/understand an existing watchdog kernel driver and use what it exposes in user space. ...