Page 1 of 1

*** SOLVED *** Problem with IPIs

Posted: Mon Aug 10, 2009 10:18 pm
by chrisf
Hey guys,

I keep getting a GPF after I send a second IPI (the code is currently running an IPI and then sends another). BOCHS gives me this error "interrupt(): gate descriptor is not valid sys seg (vector=0xff)". I can't find the problem. The APIC pointer is stored correctly, the interrupt runs fine when int 51d is added into the code, an EOI has already been sent to the APIC, interrupts are enabled, and the code for the interrupt and IPI sender is not getting overwritten by anything. Here's the code that sends the IPI. It's copy and pasted from the code that sends the first IPI which works fine.

Code: Select all

Send_Finished_IPI:
mov ax, 18h
mov ds, ax
mov ax, 20h
mov es, ax

mov ebx, [MP_APIC]
xor eax, eax

mov [es:ebx + 310h], eax

mov eax, 10000100000000000000b
or al, 51d

mov [es:ebx + 300h], eax

jmp EndlessLoop
Oddly enough switching the interrupt to 49d (keyboard ISR) works fine. Inserting the instruction int 51d right before the IPI is sent causes the code to work correctly. Any ideas as to what's wrong?

Re: *** SOLVED *** Problem with IPIs

Posted: Wed Aug 12, 2009 1:51 pm
by chrisf
Problem solved. Forgot to enable the APIC.