Trap :
A trap is a software generated interrupt caused either by an error (like division by zero, invalid memory access etc.) , Or an by a specific request for an operating system generated by a user program. Trap is sometimes called exception. Its handling is synchronous .
Interrupt :
An interrupt is something generated by the device like the hard disk graphics card input/output ports etc. These are asynchronous or "passive" since the interrupt handler has to wait for them to happen eventually. Interrupt occur at random times during the execution of a program. Software can also generate interrupt by executing the INT instruction.
It is important to note that trap and interrupt are closely related. Trap are are a type of exception and exceptions are similar to interrupts.
Comments
Post a Comment