Computer System Interruptions Traps
Computer system interruptions can occur by interrupts or traps. Interrupts and traps originate from the execution of a process on a computer, which sometimes, possibly may generate events that could bring the computer to a standstill. The interruptions occur because of hardware or software errors. Interrupts are program control interruptions that occur because of external hardware errors. Keyboard, mouse, and disk drives are external hardware that may delay the computer. When interrupts occur a signal is sent to inform a program that an event has taken place. Interrupts completely stops computers from functioning. When interrupts occur “control is first transferred to an interrupt handler” (Stallings, 2012, pg. 137). The interrupt vector chooses the interrupt handler. An interrupt vector is “an array in the operating system that maps interrupts numbers to interrupt handler addresses” (Singh, 2013, pg. 1). Once an interrupt handler is assigned to the state of the computer will go back to original state before interrupt occurred.
A trap is a software error interrupt purposely set off by a programmer. When traps occur control transfers to a trap handler. The trap vector chooses the trap handler. A trap vector “is an array in the operating system that maps trap numbers to trap handler addresses” (Singh, 2013, pg. 1). Interrupts are asynchronous and traps are synchronous. Asynchronous is to have each process start after a previous process completion. Synchronous is to have each process happening at the same time.
Singh, D. (2013, March). Difference between Interrupt and Trap. Tech-Experts.
Stallings, W. (2012). Operating Systems: Internals and Design Principles, (7th Ed.). Pearson