Interrupts: Difference between revisions

Jump to navigation Jump to search
m
→‎From the PIC's perspective: Removed unnecessary opinion.
[unchecked revision][unchecked revision]
m (Fix typo: Unices -> Unixes)
m (→‎From the PIC's perspective: Removed unnecessary opinion.)
Line 38:
and the PIC sends the interrupt assigned to IRQ 3, which the CPU handles (using the IDT to look up the handler for that interrupt).
 
Alert readers will notice that the CPU has reserved interrupts 0-31, yet IRQs 0-7 are set to interrupts 08-0Fh. Now the reserved interrupts are called when, for example, a dreadful error has occurred that the OS must handle. Now when the computer first starts up, most errors of this type won't occur. However, when you enter protected mode (and every OS should use protected mode, real mode is obsolete), these errors may occur at any time, and the OS needs to be able to handle them. How's the OS going to tell the difference between INT 9, Exception: Coprocessor segment overrun, and INT 9: IRQ 1? Well, it can ask the device whether there is really an interrupt for that device. But this is slow, and hackish, and not all devices are able to do this type of thing. The best way to do it is to tell the PIC to map the IRQs to ''different'' interrupts, such as INT 78h-7Fh. For information on this, see the [[PIC]] FAQ. Note that IRQs can only be mapped to INTs that are multiples of 08h: 00h-07h, 08h-0Fh, 10h-17h, 17h-1Fh. And you probably want to use 20h-27h, or greater, since 00h-1Fh are reserved by the CPU. Also, each PIC has to be programmed separately. You can tell the Master PIC to map IRQs 0-7 to INTs 20h-27h, but IRQs 8-F will still be INTs 70h-77h, unless you tell the Slave PIC to put them elsewhere as well.
 
See [[PIC#Programming the PIC chips|programming the PIC chips]] for detailed information.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu