From PMode back to RMode
Posted: Tue Nov 11, 2008 9:33 am
I want to go from pmode back to rmode and have read the intel manuals, but my code is not working and I don´t know where the problem is.
I have this GDT:
My code is some where behind 0x10000 and this is the code where I try to jump back:
I do not jump to the 16bit segment, because this also doesn´t work.
I have this GDT:
Code: Select all
GDT:
;null descriptor
dw 0
dw 0
dw 0
dw 0
;code descriptor
dw 0ffffh
dw 0
dw 9a00h
dw 0cfh
;data descriptor
dw 0ffffh
dw 0
dw 9200h
dw 0cfh
;code 16bit descriptor
dw 0xffff
dw 0
dw 0x9801
dw 0
Code: Select all
mov eax,.rmode
mov [.offset],ax
mov eax,cr0
and al,~1
mov cr0,eax
db 0xea
dw 0x1000
.offset:
dw 0
;----------------------------
; rmode
align 16
.rmode:
use16
jmp $