Getting interrupt's number within it's handler

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Getting interrupt's number within it's handler

Post by Candy »

B.E wrote: I'm guessing the you would be able to get the interrupt's number from the PIC or the APIC.
For hardware interrupts, yes. Software interrupts and exceptions don't cooperate with that.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Getting interrupt's number within it's handler

Post by Pype.Clicker »

Candy wrote:
B.E wrote: I'm guessing the you would be able to get the interrupt's number from the PIC or the APIC.
For hardware interrupts, yes. Software interrupts and exceptions don't cooperate with that.
you have code/tutorials/datasheets/whatever for that ??
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Getting interrupt's number within it's handler

Post by Candy »

Pype.Clicker wrote: you have code/tutorials/datasheets/whatever for that ??
Reference from "The Indispensable PC Hardware Book, V4", chapter 17 about the PIT, they describe how to read the ISR and IRR registers using OCW3. They're described as the "Interrupt Request Register" and the "In-Service Register". I figured using the ISR you could determine which one was in service.

Note that this still doesn't work for exceptions. There is also, as far as I know, no way to check for any given exception.
Post Reply