Reputation: 505
What is the difference between a signal, a software interrupt and a hardware interrupt? Please tell me with one example??
Upvotes: 4
Views: 6423
Reputation: 215144
In the C language, signals mean a form of internal program communication found in signal.h. You could perhaps compare them with "events" or "excpetions" in other languages or in the OS. It was an attempt to give language support to such OS functionality. http://en.wikipedia.org/wiki/Signal.h
Software interrupt refers to specific interrupts in the CPU that were caused by the software going wrong on a low, fundamental level, i.e. executing an unknown OP-code or attempting to access unused memory areas. The software interrupt is called by the CPU itself and not by the OS or application.
Hardware interrupts are every other kind of interrupt that isn't a software one. They are called by the CPU itself. Their nature is application- and hardware specific.
Upvotes: 2
Reputation: 63310
From wikipedia:
In computing, an interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution. A hardware interrupt causes the processor to save its state of execution and begin execution of an interrupt handler. Software interrupts are usually implemented as instructions in the instruction set, which cause a context switch to an interrupt handler similar to a hardware interrupt.
Upvotes: 1