page fault?
Posted: Sun Mar 30, 2008 10:33 am
Hey everyone,
I have a quick question. I am writing the 3rd revision of my bootloader and am attempting to task switch to v86 mode. However, it always seems to page fault when executing the task. I do not understand why, though.
Here is the code:
Running it through bochs debugger, we get to the hlt instruction. The very next instruction is my page fault exception handler being executed.
It seems to work fine with or without paging (Even when I add alot more code); I only get a page fault when I switch to v86 mode. (ie, if I comment out the IRET, everything will work fine even with paging.)
Does anyone have any suggestions on where to look next?
Thanks!
I have a quick question. I am writing the 3rd revision of my bootloader and am attempting to task switch to v86 mode. However, it always seems to page fault when executing the task. I do not understand why, though.
Here is the code:
Code: Select all
; go into v8086 mode
push dword 0x0 ; real mode gs
push dword 0x0 ; real mode fs
push dword 0x0 ; real mode ds
push dword 0x0 ; real mode es
push dword 0x0 ; real mode ss
push dword 0xffff ; real mode esp
push dword 0x20002 ; real mode eflags
push dword 0x0 ; real mode cs
push dword stage3 ; real mode eip
iret
bits 16
stage3:
hlt
jmp $
It seems to work fine with or without paging (Even when I add alot more code); I only get a page fault when I switch to v86 mode. (ie, if I comment out the IRET, everything will work fine even with paging.)
Does anyone have any suggestions on where to look next?
Thanks!