Search code examples
interruptprocessor

How can the processor recognize the device requesting the interrupt?


1) How can the processor recognize the device requesting the interrupt?

2) Given that different devices are likely to require different ISR, how can the processor obtain the starting address in each case?

3) Should a device be allowed to interrupt the processor while another interrupt is being serviced?

4) How should two or more simultaneous interrupt requests be handled?


Solution

  • 1) How can the processor recognize the device requesting the interrupt?

    The CPU has several interrupt lines, and if you need more devices than there are lines there's an "interrupt controller" chip (sometimes called a PIC) which will multiplex several devices and which the CPU can interrogate.

    2) Given the different devices are likely to require different ISR How can the pressor obtain the starting address in each case?

    That's difficult. It may be by convention (same type of device always on the same line); or it may be configured, e.g. in the BIOS setup.

    3) Should a device be allowed to interrupt the processor while amother interrupt is being services?

    When there's an interrupt, further interrupts are disabled. However the interrupt service routine (i.e. the device-specific code which the CPU is executing) may, if it's willing, reenable interrupts if it's willing to be interrupted.

    4) How should two or more simultanement interrupt requests be handled?

    Each interrupt has a priority: the higher-priority interrupt is handled first.