5
votes

What is the difference between vectored and non vectored interrupts?

I thought all interrupts had to be vectored interrupts... After all don't all interrupts have a vector number and thus a vector with a specific ISR [interrupt service routine]

(ISR address would in the page table, at 4 * the vector # in device that generated interrupt; assuming a 32 bit address architecture)....

Thanks!

4

4 Answers

7
votes

See here:

  • Vectored interrupts: Device tells CPU that it needs attention, identifying itself via the interrupt
  • Polled interrupts: CPU has to poll multiple devices to see which one had requested attention
3
votes

Whenever an interrupt occurs, the CPU needs to execute a Handler, which is basically a subroutine that handles the interrupt. Now how the CPU accesses this handler depends on the type of interrupt.

In case of Vectored interrupt, the vector number specifies the address of the Handler, hence the CPU jumps to the address and executes the handler.

On the other hand, non vectored interrupts are generally raised by I/O (slow) devices. In this case there is always a specific handler that needs to be executed, hence no need to pass a vector for the address of the handler

2
votes

The important feature of a vectored interrupt is that the device itself provides the interrupt vector address.

With non-vectored interrupts, all devices using the same interrupt request routine will transfer control to the same location, and the interrupt service routine will have to figure out which of the possible devices is actually interrupting.

With a vectored interrupt, the device tells the interrupt mechanism what its vector address is. The vector address corresponds to a store location in which the OS (or device driver) has written the address of an appropriate interrupt service routine. Typically each device has its own vector address so the "which device is interrupting" decision is trivial.

The terminology is a little messed up, since the table of interrupt service routine addresses is frequently called the "interrupt vector table", but the term used for both vectored interrupts (interrupting device identifies a slot in the vector) and non-vectored interrupts (interrupt request line corresponds to a slot in the vector).

-1
votes

When the external device interrupts the CPU (interrupt request), CPU has to execute interrupt service routine for servicing that interrupt. If the internal control circuit of the processor produces a CALL to a predetermined memory location which is the starting address of interrupt service routine, then that address is called vector address and such interrupts are called vector interrupts.