APIC Programming Question
APIC Programming Question
I have looked around the Wiki, searched the forums, and Google'd furiously and I can't find an answer to this question. I understand that the newer processors (Pentium on up) are situated with an APIC, vice the standard PIC setup. What I can't find is how to setup and program the APIC for IRQs, like you do with the PIC. The PIC is very straight forward, but nothing I've found shows anything on the APIC, other than APIC I/O, which looks like a SMP type thing, not a uni-core setup. So, my question is, how do you program the APIC for IRQs in a uni-processor system?
Re: APIC Programming Question
I have no idea about anything referring to the PIC or related topics, but when you mentioned the wiki, it made me wonder if you'd seen this article, I think it may be on the topic you're asking about.
Re: APIC Programming Question
I did, thank you. Unfortunately, this article is not very helpful.
Re: APIC Programming Question
The IOAPIC isn't just for multiprocessor systems.
Re: APIC Programming Question
Hi,
There's actually 4 cases:
For the "local APIC but no I/O APIC" case you still need to use the PICs, but you can use the local APIC timer and the other interrupts built into the local APIC (e.g. termal status interrupt, performance monitoring interrupt). This can make a huge difference for timing (the extra precision of the local APIC timer; plus the ability to know when the TSC frequency changes due to thermal throttling).
Cheers,
Brendan
Correct. Most computers with local APICs and I/O APICs have ACPI and/or MP specification tables too (so you can find out which IRQs are connected to which I/O APIC inputs, etc).Hangin10 wrote:The IOAPIC isn't just for multiprocessor systems.
There's actually 4 cases:
- Single-CPU with no APICs - mostly old computers (e.g. Pentium III or later)
- Single-CPU with local APIC but no I/O APIC - not as common, but does happen in older computers (especially older servers)
- Single-CPU with both local APICs and I/O APIC - common for Pentium 4 and later systems
- Multi-CPU with both local APICs and I/O APIC - all multi-CPU systems since 80486
For the "local APIC but no I/O APIC" case you still need to use the PICs, but you can use the local APIC timer and the other interrupts built into the local APIC (e.g. termal status interrupt, performance monitoring interrupt). This can make a huge difference for timing (the extra precision of the local APIC timer; plus the ability to know when the TSC frequency changes due to thermal throttling).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: APIC Programming Question
Ahh, ok. Thank you for the clarification. The part that still confuses me is the setup. Do you need to setup the APIC and IOAPIC like you do the 8259A PIC? I also have "The Indispensable PC Hardware Book", which gives a great discussion on the 8259A, but not much on APIC or IOAPIC.
Re: APIC Programming Question
There is a chapter about APIC in Intel Doc : Chapter 9 of volume 3A (http://www.intel.com/products/processor/manuals/)