Page 1 of 1

The Jump to Protected Mode

Posted: Mon Jan 13, 2003 6:35 am
by weathermanfrank
Hi again,

I'm having a bit of trouble setting up my segment registers with the segment selectors out of the GDT. Now I'm not really sure if it's just a bad descriptor table or what so I came here looking for a hint or two. I'll post the last bit of code that I'm working on.


code:
mov eax, cr0
or eax, 1
mov cr0, eax

jmp pm_entry

pm_entry:
mov ax, dataSeg ;this triple faults the CPU?


;-----------------------------------------------------------------------
;GDT
;-----------------------------------------------------------------------

So thats where I am. Stuck so if any one could shed a bit of light on the subject I would be gratful.

Thank Frank
gdtr
dw gdt_end - gdt - 1
dd gdt

gdt
gdt0
dd 00h
dd 00h

codeSeg equ $ - gdt
dw 0FFFFh
dw 00h
db 00h
db 9Ah
db 0CFh
db 00h
dataSeg equ $ - gdt
dw 0FFFFh
dw 00h
db 00h
db 92h
db 0CFh
db 00h
gdt_end
;-----------------------------------------------------------------------
;end GDT
;-----------------------------------------------------------------------