Setting protected mode fails on some PCs
Posted: Wed Oct 20, 2010 2:02 pm
I've created a bootloader that can successfully load a kernel with A20, protected mode and all the rest. On VirtualBox and my laptop there is no problem, but when I try it on my PC it triple faults (at least it restarts) after setting the protected mode bit in CR0. I have followed the execution to confirm this is the source of the problem.
Please let me know if you need to see any more code.
Code: Select all
;------------------------------------------------------------------------------
; Load GDT.
;------------------------------------------------------------------------------
lgdt [GDT_DESC] ; Load GDT
; GETS TO HERE FINE
;------------------------------------------------------------------------------
; Protected mode.
;------------------------------------------------------------------------------
mov eax, cr0 ; Copy CR0 into EAX
or eax, 1 ; Set bit 0
mov cr0, eax ; Update CR0
;!!!!!!!!!!!!!!HERE IS THE PROBLEM!!!!!!!!!!!!!!!!!!!!!!!!!!!!
; IT NEVER REACHES HERE
jmp 0x08:ClearPipe ; Setup registers