I've been trying to start up my APs. what i did initially ws jus make them increment a counter in memory. And that worked and i ws getting them al started up. But after that I tried setting up gdt and tryin to jump them into protected mode. It jus doesnt seem to work. it breaks... Triple fault! I'd really appreciate it if u guys could take a look at my code and tel me wat's wrong. What i do, is i copy the AP startup code to a low memory location and the APs jump to it on startup. I know it's something to do wit me referencing symbols not accesible to the APs.. but i jus cant seem to find a way around it.. Thanks for ur time guys..
Code: Select all
bits 16 ; We are still in 16 bit Real Mode
global AP_startup
extern AP_main
extern AP_stage3
extern Stage3
;*************************************************;
; Bootloader Entry Point
;*************************************************;
AP_startup:
; Incrementing processor count - THIS WORKS FINE. SO APs ARE STARTING UP
mov bx, 500h
lock
inc byte [bx]
mov ax, cs
mov ds, ax
;EFLAGS
push 2
popf
mov bx, 0x600
;Loading GDT and IDT
lgdt [bx]
; Enabling Protected mode
mov eax, cr0
or al, 1
mov cr0, eax
; Far jump... THIS IS WAT IS SCREWED.. I GET A RELOCATION ERROR
jmp 0x8:Pmode
bits 32
Pmode:
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
call AP_main
cli ; Clear all Interrupts
hlt ; halt the system