The main question is how reset button from the desktop computer works. How processor deals with reset button hardware interrupt.
And Why there is need of reset buttons to computer.
if so
then Why laptop computer does not have reset button.
Again... please tell me How processor deals with reset button press interrupt even when computer is in " hang " position.
if computer(processor) is in hang condition means processor is overloaded with processes and it can not process tasks now then how he can handle or process on reset interrupt.
thanks
How processor deals with reset button hardware interrupt.
The reset signal does not generate a hardware interrupt! A CPUs contain a special, so called reset circuit, which set the CPU into a well known, initial state. Among other things it sets the so called instruction, or program counter to the reset vector address.
And Why there is need of reset buttons to computer.
Because there can be conditions in which the program(s) executed by the CPU end up in a situation from which it can't get out. For example say you have 4 conditions A, B, C and D, each of which interferes with the other ones. So you have to introduce locking between them. But implementing proper locking schemes is hard, and it can happen (due to bugs), that you end up in a circular locking condition. Think about something like this:
This is very much like what happens when a computer locks up. It's not that the thing is somehow overloaded, or busy with doing things. On the contrary, its tangled up in a situation where it can't move forward or backward.
if so then Why laptop computer does not have reset button.
Mostly for practical reasons: A desktop computer resides in a fixed place and you normally don't have your hands on the case the whole time. Pressing the reset button is a very disruptive thing to do, loosing all your unsaved work. A laptop is carried around and you constantly press all the buttons, built into it. The danger of accidently pressing the reset button, either by the user, or when the laptop rattles around in the bag when moving is a too high risk, than the benefits of having it.
All the other buttons on a computer are soft buttons, i.e. the action they actually trigger is controlled by software on the main CPU. Except the power button, which is managed by the system management controller, which is an independent small processor, dealing mostly with turning things on or off in the right order and keeping any eye on the hardware health (voltage, temperature, etc.)
if computer(processor) is in hang condition means processor is overloaded with processes and it can not process tasks now then how he can handle or process on reset interrupt.
As I already explaint, a deadlock doesn't mean that the CPU is overloaded. Most of the time it means, that it tangled up in a situation it can't get out again. Most deadlocks are isolated to only certain programs, in that case you either don't notice them, or you can still use the normal reboot. However some lockups happen deep in the operating system. And sometimes (those are the worst) they happen, when interrupts have been disabled alltogether.
Simply spoken, there are conditions where you must do things on the metal level. The reset button does not start a little piece of code. It's wired to circuitry on the CPU (and the system management controller) that resets the hardware into the reset state just by sending an electrical signal through the silicon.