BOCHS + SMP error
Posted: Sun May 10, 2009 2:59 pm
Hello,
I'm writing software to enable symmetric multiprocessing. Currently its being tested in BOCHS. My software can locate both MP tables and parse them fine. The problem comes when trying to send the INIT IPI. It looks like it's never actually being sent. I'm guessing there are two sections of my code that the problem could be in: the part that initializes the APIC and the part that sends the IPI.
Here is the section that enables the APIC:
The ES segment register is correct ... I have two GDT entries and the value in ES allows for access of all 4 GB of memory.
The code above will loop infinitely at TestLoop. EAX will always have a value of FFFFFFFFh.
Any ideas? Thanks.
I'm writing software to enable symmetric multiprocessing. Currently its being tested in BOCHS. My software can locate both MP tables and parse them fine. The problem comes when trying to send the INIT IPI. It looks like it's never actually being sent. I'm guessing there are two sections of my code that the problem could be in: the part that initializes the APIC and the part that sends the IPI.
Here is the section that enables the APIC:
Code: Select all
;Set up spurious interrupt.
mov eax, [es:0fee000F0h]
or eax, 256d
mov [es:0fee000F0h], eax
;Set up error vector.
mov eax, [es:0fee00370h]
and eax, 0FFFFFF00h
or eax, 0Ah
mov [es:0fee00370h], eax
;Set up timer vector
mov eax, 00010021h
mov [es:0fee00320h], eax
;Set up LINT0, LINT1, and performance counter INT
mov eax, 00000700h
mov [es:0fee00340h], eax
mov [es:0fee00350h], eax
mov [es:0fee00360h], eax
Code: Select all
MultiprocessorTestLoop:
mov ax, 10h
mov ds, ax
mov ax, 18h
mov es, ax
lea esi, [MultiprocessorCode]
mov edi, 8000h
mov ecx, 6h
cld
rep movsb
xor ebx, ebx
mov eax, 000C4500h
mov [es:0ffe00310h], ebx
mov [es:0ffe00300h], eax ;Send INIT
mov ecx, 87654321h
TestLoop:
mov eax, [es:0ffe00300h]
test eax, 4096d
jnz TestLoop
mov ecx, 12345678h
jmp PMEndlessLoop
call MultiprocessorWait10MS
mov eax, 000C4608h
mov [es:0ffe00300h], eax ;Send SIPI
jmp PMEndlessLoop
mov ecx, 100000d
NopLoop1:
nop
loop NopLoop1
mov [es:0ffe00300h], eax ;Send SIPI again
jmp PMEndlessLoop
The code above will loop infinitely at TestLoop. EAX will always have a value of FFFFFFFFh.
Any ideas? Thanks.