Code: Select all
00035450815d[APIC0] trigger interrupt vector=0x21
00035450815d[APIC0] triggered vector 0x21
00035450815d[APIC0] triggered vector 0x21 not accepted
Bochs' debugger confirms the APIC LVT Vector as well as the IDT Vector are set correctly and to the correct address for the ISR.
I'm at a complete loss.
When I do call the interrupt using
Code: Select all
asm volatile("int $0x21");
My APIC code looks like this:
Code: Select all
uint64_t apic = *((uint64_t *)0x5000); // 0x5000 contains address of the APIC from bootloader code
*((uint32_t *)(apic + APIC_SPUR)) |= 0x0100 | 0xFF; // software enable and 0xFF as spurious vector
*((uint32_t *)(apic + APIC_LDR)) = 0xFF000000;
*((uint32_t *)(apic + APIC_DFR)) = 0xF0000000;
*((uint32_t *)(apic + APIC_TPR)) = 0x00000000;
*((uint32_t *)(apic + APIC_TDCR)) = 0x00000003; // divisor of 16
*((uint32_t *)(apic + APIC_TMRLVTR)) = 0x00020000 | vector; // set to 0x21 in this case
*((uint32_t *)(apic + APIC_TICR)) = 0x00006400;