I have a little problem with the on-the-fly pmode-realmode switching.
This is a function I use to switch from real mode to protected:
Code: Select all
SwitchToPmode: ;Prepni do pmode
pushad
cli ;Zakáž prerušenia
lgdt [gdtr] ;NaÄ
Code: Select all
SwitchToPmode: ;Prepni do pmode
pushad
cli ;Zakáž prerušenia
lgdt [gdtr] ;NaÄ
Code: Select all
call SwitchToPmode
mov ax,10h
sub ax,6
div ax
jmp $
Code: Select all
(after the RET from SwitchToPmode)
mov eax, 0xe8830010 (should be mov eax,0x10)
push es
div eax, eax
jmp .+0xfffffffe (jmp $)