General IRQ routing on x86_64
Posted: Sun Feb 10, 2013 11:27 am
I'm working on a general-purpose limited hardware abstraction layer (limited in that it only deals with the processor and core platform components, not peripheral devices) and I'm trying to figure out the easiest and least limiting way to initialize IRQ routing so that whatever is built on top of it can express which IRQs it wants to wait for in a consistent fashion. I've already got what I believe to be an adequate API on the software side, which resembles a select() interface with an additional call for sending EOIs.
What I'm stuck on is getting the APIC architecture to send interrupts to the right places in such a way that I can figure out which device they actually came from. I'm used to dealing with the legacy 8259 PIC, which I used in my last project, so I'm not yet fully acquainted with the whole I/O APIC mess. It seems like there are a lot of methods out there to try and untangle IRQ routing (MP tables, ACPI tables, etc.) but a lot of it is old, and I can't seem to figure out what the "standard" method is nowadays. I really only want to target x86_64 hardware with SMP support, and can deal with dropping support for anything more than 5 years old. The primary purpose of the project is as a didactic tool, and it will be running mostly on virtualized hardware.
What would those of you who have dealt with the I/O APIC recommend in this situation?
What I'm stuck on is getting the APIC architecture to send interrupts to the right places in such a way that I can figure out which device they actually came from. I'm used to dealing with the legacy 8259 PIC, which I used in my last project, so I'm not yet fully acquainted with the whole I/O APIC mess. It seems like there are a lot of methods out there to try and untangle IRQ routing (MP tables, ACPI tables, etc.) but a lot of it is old, and I can't seem to figure out what the "standard" method is nowadays. I really only want to target x86_64 hardware with SMP support, and can deal with dropping support for anything more than 5 years old. The primary purpose of the project is as a didactic tool, and it will be running mostly on virtualized hardware.
What would those of you who have dealt with the I/O APIC recommend in this situation?