*** SOLVED *** Problem with IPIs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
chrisf
Posts: 3
Joined: Sun May 10, 2009 2:48 pm

*** SOLVED *** Problem with IPIs

Post 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?
chrisf
Posts: 3
Joined: Sun May 10, 2009 2:48 pm

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

Post by chrisf »

Problem solved. Forgot to enable the APIC.
Post Reply