5

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!

rrazd
  • 1,741
  • 2
  • 32
  • 47

4 Answers4

7

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
user541686
  • 205,094
  • 128
  • 528
  • 886
3

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

AmanMohla
  • 129
  • 1
  • 6
  • You say "on the other hand non vectored interrupts are raised by I/O devices" -- BUT Aren't ALL interrupts (vectored and non vectored) raised by I/O devices? Can you please clarify? Otherwise +1 for a clear first 2 paragraphs! =) – rrazd Jun 29 '11 at 13:37
  • A call to a subprogram is also an interrupt. e.g. If you would have programmed in any High Level Language and you call a function then that is also a kind of interrupt and it is a type of vectored interrupt where you know the address of the function to be invoked. – AmanMohla Jul 12 '11 at 04:41
  • function call instructions to subroutines in the same program are not interrupts, just ordinary branches. (Unless you're talking about x86 `call far` through a call gate, then it's a system call not a function call). – Peter Cordes Feb 01 '20 at 03:17
2

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

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.

loyola
  • 3,905
  • 2
  • 24
  • 18