Re: operating system
Hello rameshbabu,
when designing embedded SW it is important to assure that the CPU will not be locked by a task that doesn't end (e.g. the SW has entered a infinite loop because of a bug not detected before).
To prevent these stalling conditions some MCU are equipped with internal watchdog (WD) circuitry. Basically it is a dedicated timer circuit, controlled by the status of the bit on a set of internal CPU registers: once the timer has been started, if the write of a particular code in the registers is not detected before the counter expires the CPU is automatically reset. The write of the refresh code restart the timer and re-arms the WD for the next period.
In this way the system has the capability to self-recover from unforeseen and non recurrent hang-up conditions (just think at the times you pressed the ctrl-alt-canc sequence with Windows ;-) ). Otherwise you should have to switch off/on the device but this is not always possible!
For OS I think that the concept is the same, but instead of dedicated circuitry you have a dedicated task running at lowest priority, which periodically resets the WD timer when the higher priority processes release the control to it.
If a process hang-up for any reason, the WD task will not be scheduled causing the WD timer to expire and an error condition will be raised to the OS.
Regards
Mowgli