Mapping the I/O Apic
Posted: Sun Apr 09, 2006 7:56 am
Hello,
I'm currently working on my I/O Apic code and ran into some problems as I'm not quite sure how to initialize the interrupt redirection entries. After parsing Intel's multiprocessor table and examinig the result I'm now even more stumbled:
[pre]o----o--------------o------o------o------o-------o
|irq | windows says | Type | Bus | Pol | Edge |
o----o--------------o------o------o------o-------o
| 00 | sysclock | EXT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 01 | kbd | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 02 | | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 03 | COM2 | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 04 | COM1 | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 05 | | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 06 | FDC | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 07 | | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 08 | RTC | INT | ISA | high | edge |
o----o--------------o------o------o------o-------o
| 09 | ACPI | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 10 | MIDI | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 11 | SMBus | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 12 | Mouse | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 13 | CoProcessor | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 14 | Prim ATA | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 15 | Sec ATA | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 16 | 2*USB, VGA | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 17 | Sound | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 18 | USB | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 19 | USB | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 20 | | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 21 | | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 22 | Ethernet | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 23 | PCI-USB | INT | PCI | low | level |
o----o--------------o------o------o------o-------o[/pre]
Obviously windows remapped some of the PCI irqs:
- IRQ #11 is ISA in the table but PCI in windows
- I found two entries for IRQ #16 but in windows there are 3 devices connected two it
- There are also 2 entries for IRQ #18 but only one windows device
As one of the IRQ #16 devices is definitly the graphic-card (I can tell because it has an PCI bus of its own), I somehow assume that windows must have remapped one of the USB controllers from IRQ #18 to IRQ #16.
Wouldn't it however be way more logical to give the AGP card an exclusive IRQ line and have two of the USB controllers (which are way less important anyway) share a single line ? Apart from that IRQs #20 and #21 are not used at all. Are there some hardware restrictions that keep PCI from using these lines or is my computer just poorly set-up ?
I'm also wondering why the SMBus Controller gets mapped to an interrupt that is normally used by ISA devices..
On an other computer (-that uses some rather cheap board-) the multiprocessor table isn't even complete. There are only 10 entries in it, while windows enumerates 15 IRQs in its hardware manager. What's missing are almost all legacy ISA devices except for PIT, keyboard and some mysterious IRQ #2 which doesn't correspond to any device window uses. I'm wondering how other operating systems actually detect these devices, after all they'll hardly be in the ACPI tables either..
While there are too few ISA enties, all PCI are enumerated correctly. Actually there's even one entry too much, but that hardly matters in that case.
With all this I was wondering how reliable the multiprocessor table really is. It's not only incomplete on some computers, but also only preliminary as a lot of IRQs obviously have to be remapped first. Wouldn't it be more resonable to dump the whole table in favor on some PCI bus specific detection routines ? I'm however not sure what to do with the ISA devices then..
regards,
gaf
I'm currently working on my I/O Apic code and ran into some problems as I'm not quite sure how to initialize the interrupt redirection entries. After parsing Intel's multiprocessor table and examinig the result I'm now even more stumbled:
[pre]o----o--------------o------o------o------o-------o
|irq | windows says | Type | Bus | Pol | Edge |
o----o--------------o------o------o------o-------o
| 00 | sysclock | EXT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 01 | kbd | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 02 | | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 03 | COM2 | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 04 | COM1 | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 05 | | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 06 | FDC | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 07 | | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 08 | RTC | INT | ISA | high | edge |
o----o--------------o------o------o------o-------o
| 09 | ACPI | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 10 | MIDI | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 11 | SMBus | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 12 | Mouse | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 13 | CoProcessor | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 14 | Prim ATA | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 15 | Sec ATA | INT | ISA | std | std |
o----o--------------o------o------o------o-------o
| 16 | 2*USB, VGA | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 17 | Sound | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 18 | USB | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 19 | USB | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 20 | | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 21 | | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 22 | Ethernet | INT | PCI | low | level |
o----o--------------o------o------o------o-------o
| 23 | PCI-USB | INT | PCI | low | level |
o----o--------------o------o------o------o-------o[/pre]
Obviously windows remapped some of the PCI irqs:
- IRQ #11 is ISA in the table but PCI in windows
- I found two entries for IRQ #16 but in windows there are 3 devices connected two it
- There are also 2 entries for IRQ #18 but only one windows device
As one of the IRQ #16 devices is definitly the graphic-card (I can tell because it has an PCI bus of its own), I somehow assume that windows must have remapped one of the USB controllers from IRQ #18 to IRQ #16.
Wouldn't it however be way more logical to give the AGP card an exclusive IRQ line and have two of the USB controllers (which are way less important anyway) share a single line ? Apart from that IRQs #20 and #21 are not used at all. Are there some hardware restrictions that keep PCI from using these lines or is my computer just poorly set-up ?
I'm also wondering why the SMBus Controller gets mapped to an interrupt that is normally used by ISA devices..
On an other computer (-that uses some rather cheap board-) the multiprocessor table isn't even complete. There are only 10 entries in it, while windows enumerates 15 IRQs in its hardware manager. What's missing are almost all legacy ISA devices except for PIT, keyboard and some mysterious IRQ #2 which doesn't correspond to any device window uses. I'm wondering how other operating systems actually detect these devices, after all they'll hardly be in the ACPI tables either..
While there are too few ISA enties, all PCI are enumerated correctly. Actually there's even one entry too much, but that hardly matters in that case.
With all this I was wondering how reliable the multiprocessor table really is. It's not only incomplete on some computers, but also only preliminary as a lot of IRQs obviously have to be remapped first. Wouldn't it be more resonable to dump the whole table in favor on some PCI bus specific detection routines ? I'm however not sure what to do with the ISA devices then..
regards,
gaf