Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 08-02-2013, 01:46 AM   #1
LQ Newbie
Registered: Jun 2013
Posts: 27

Rep: Reputation: Disabled
help writing watchdog timer driver


After successfuly learning how to crosscompile linux kernel and application for embedded devices I am learning device driver development and I want to write watchdog driver for my pandaboard running linux but I have no idea where to start. I have written linux kernel modules so I know how to write a basic character driver but I am not able to find any reference material for writing watchdog timer device driver for omap4. Please point me in the right direction and if possible give me links to concerned reference material.

Old 08-03-2013, 08:25 AM   #2
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,920
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Member Response


Linux does provide a watchdog timer.
The following is dated but can be used for references. Look at the kernel version you are wishing to work with to get better detail.

Look at & watchdog-api.txt
The Linux Watchdog driver API.
6 Copyright 2002 Christer Weingel <>
8 Some parts of this document are copied verbatim from the sbc60xxwdt
9 driver which is (c) Copyright 2000 Jakob Oestergaard <>
11 This document describes the state of the Linux 2.4.18 kernel.
13 Introduction:
15 A Watchdog Timer (WDT) is a hardware circuit that can reset the
16 computer system in case of a software fault. You probably knew that
17 already.
19 Usually a userspace daemon will notify the kernel watchdog driver via the
20 /dev/watchdog special device file that userspace is still alive, at
21 regular intervals. When such a notification occurs, the driver will
22 usually tell the hardware watchdog that everything is in order, and
23 that the watchdog should wait for yet another little while to reset
24 the system. If userspace fails (RAM error, kernel bug, whatever), the
25 notifications cease to occur, and the hardware watchdog will reset the
26 system (causing a reboot) after the timeout occurs..
These two links should be of help;

Hope this helps.
Old 08-05-2013, 01:51 AM   #3
LQ Newbie
Registered: Jun 2013
Posts: 27

Original Poster
Rep: Reputation: Disabled
Thanks alot for replying

I am learning how to write my own device driver from scratch. I have reference manual for omap4 watchdog timer but I dont know how to start writing my own device driver. The reference manual has a lot of register that need to be configured to make watchdog driver operational but I have no idea how to do that. The file watchdog-apt.txt & watchdog-simple.c discuss the userspace application, not how to write your own device driver. The "The Linux WatchDog Timer Driver Core kernel API" was quite helpfull but I am still lost. If you could point me in the right direction that will be very helpful.


Last edited by sallu.salmankhalid; 08-05-2013 at 03:00 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Watchdog timer code for MINI-ITX VIA CN700-8237 MBoard johnfkav Linux - Hardware 0 01-09-2010 02:16 AM
Implementing Hardware Watchdog Timer MainMeat Linux - Hardware 2 12-09-2009 09:58 AM
Intel's watchdog support iTCO_wdt - does this mean watchdog is not present? kushalkoolwal Linux - Hardware 3 02-06-2009 04:16 PM
Hardware watchdog in BIOS and Linux watchdog driver are different? travishein Linux - Hardware 1 12-22-2008 10:41 PM
Setting up Watchdog TImer with FC2 geustace Linux - Hardware 0 08-21-2004 01:47 AM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration