I/O APIC using lowest priority interrupts
Posted: Sun Mar 06, 2016 1:33 pm
Hello everyone,
I just wanted to transition my hobby OS from using the PIC to using the IO APIC for interrupt delivery but I've stumbled on some problems.
What I've done so far:
If I write in the destination the value 0xFE (all processors except BSP) then another CPU will be the one which always receives the interrupt - so far I've seen either CPU1 or CPU7.
I've read both the IO Apic and the local APIC documentation (Intel manual). The local APIC specification specifies the ability for a processor to send lowest priority interrupts is processor specific, but I did not see any limitations on receiving these kind of interrupts.
Is there something I'm missing?
Thanks in advance!
I just wanted to transition my hobby OS from using the PIC to using the IO APIC for interrupt delivery but I've stumbled on some problems.
What I've done so far:
- I programmed the PIC in cascade mode and I've masked all interrupts excepted the cascade one (bit 2 in master).
- I've parsed the ACPI MADT table to determine the IO APICs present in the system and the interrupt overrides. In my case there is 1 IO APIC and no interrupt overrides.
- I've enabled the LAPIC on the BSP and written the LDR register to 1.
- I've programmed the IO Apic redirection entries for the IRQs in which I'm interested leaving the interrupts masked. These are programmed with destination mode logical, destination 0xFF and delivery mode lowest priority. The interrupts in my case are IRQ 1 and 8 (keyboard and RTC) - the IO Apic GlobalIrqBase in the MADT was set to 0 => I programmed entries 1 and 8 in the IO Apic.
- I've enabled the LAPIC on the APs and written the LDR register to 1 << ApicId().
- I've unmasked the IO Apic entries in which I'm interested.
- I've enabled interrupts on all the processors.
- At the end of each interrupt (may be generated by the IO Apic or by the LAPIC - I also have LAPIC timer enabled on all the processors) I write to the EOI register.
If I write in the destination the value 0xFE (all processors except BSP) then another CPU will be the one which always receives the interrupt - so far I've seen either CPU1 or CPU7.
I've read both the IO Apic and the local APIC documentation (Intel manual). The local APIC specification specifies the ability for a processor to send lowest priority interrupts is processor specific, but I did not see any limitations on receiving these kind of interrupts.
Is there something I'm missing?
Thanks in advance!