Hi,
Let's start from the start...
For ISA; there was jumpers or switches on ISA cards used to select which ISA IRQ/s the card uses, and ISA IRQs were connected to PIC chip inputs. This was painful for everyone (adding a new ISA card meant investigating the existing cards and trying to find a free interrupt line manually).
Then they added PCI. PCI has 4 "PCI IRQs". They needed a way to connect them to whatever PIC IRQs happened to be unused by ISA cards (which could be using "random who knows what"). For this reason they added a "PCI IRQ router" so that PCI's IRQs could be connected to most of the PIC inputs and so it could be configured in BIOS settings. Each PCI device uses PCI IRQs in order, and (to reduce PCI IRQ sharing) the IRQ lines were connected to different PCI slots differently. That way with 4 PCI cards all using "pin #1 at the slot" they end up using different PCI IRQs at the PCI host controller. The "interrupt pin number" in PCI configuration space tells you which "pin # at the slot", which is completely useless. So that software (an OS) could figure out how PCI devices are connected to the PIC chips they used a "interrupt number" in PCI configuration space, where the BIOS (using chipset specific knowledge of how the motherboard is wired up and how it configured the "PCI IRQ router") sets this "interrupt number" in PCI configuration space for the OS.
Then they added IO APICs. These typically have 20 or more inputs and don't need any funky router thing (ISA can use 15 IO APIC inputs and PCI can use other/separate inputs); so they just connected PCI IRQs directly to IO APIC inputs. The "interrupt number" in PCI configuration space was already being used for PICs so to work around that (and because IO APICs were only really used in multi-CPU systems originally) they added the relevant information to the Multi-Processor Specification's tables.
Then ACPI came along. The problem with the older "Multi-Processor Specification's tables" is that it's a static table, and can't work for hot-plug PCI (where devices can be added/removed after the firmware creates the table). For this reason (at least that's what I assume) ACPI shifted the "which IO APIC input is used by which PCI device" into its AML. This means you need an AML interpreter just to figure out which IO APIC input a PCI device uses. The older "Multi-Processor Specification's tables" got deprecated (you can't assume they exist or are reliable on modern computers).
Then they added MSI (Message Signalled Interrupts) to PCI, first as an optional feature, then (for PCI-E) as a mandatory thing. This bypasses the IO APIC's inputs and sends a message directly. The nice thing about this is you can configure the IRQ vector (to send as a message to the CPU) in the device's PCI configuration space and don't need an AML interpreter.
omarrx024 wrote:So let's say for example, I have a PCI device with interrupt line 11, and the ACPI MADT table tells me that ISA IRQ 11 is I/O APIC IRQ 16. Can I use IRQ 16 for this device, then?
No, PCI devices are connected directly to IO APIC inputs and have nothing to do with ISA IRQs in this case.
omarrx024 wrote:And if the I/O APIC IRQ is not gotten from the interrupt line but the interrupt pin, how do I use the interrupt pin? How do I know which IRQ, INTA# for example is using?
You don't use the "interrupt pin" - it's useless without motherboard/chipset specific information. However ACPI's AML may use the "interrupt pin" in conjunction with chipset specific voodoo to figure out the IO APIC input for the device.
Cheers,
Brendan