Triple fault error on page directory swich

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
balthasar
Member
Member
Posts: 30
Joined: Mon Mar 31, 2008 8:39 pm
Contact:

Triple fault error on page directory swich

Post by balthasar »

on MemoryManager.cpp line 217 is the code thats causing the triple fault

i cant figure out to the life of me why its not working, it worked when it was in C.

Help is needed sources can be viewed here http://code.google.com/p/ensemble/sourc ... #svn/trunk
My OS: NasuTek Ensemble http://code.google.com/p/ensemble/
User avatar
balthasar
Member
Member
Posts: 30
Joined: Mon Mar 31, 2008 8:39 pm
Contact:

Re: Triple fault error on page directory swich

Post by balthasar »

also here is the Bochs log where the error occured (maybe it can help)
00067827234i[CPU0 ] | EAX=00001000 EBX=00026260 ECX=00000700 EDX=000003ff
00067827234i[CPU0 ] | ESP=00067e60 EBP=00067e60 ESI=000263fa EDI=00026408
00067827234i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df IF tf sf zf AF PF cf
00067827234i[CPU0 ] | SEG selector base limit G D
00067827234i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00067827234i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 ffffffff 1 1
00067827234i[CPU0 ] | DS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00067827234i[CPU0 ] | SS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00067827234i[CPU0 ] | ES:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00067827234i[CPU0 ] | FS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00067827234i[CPU0 ] | GS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00067827234i[CPU0 ] | EIP=00102b2d (00102b2d)
00067827234i[CPU0 ] | CR0=0xe0000011 CR2=0x001094a0
00067827234i[CPU0 ] | CR3=0x00001000 CR4=0x00000000
00067827234e[CPU0 ] exception(): 3rd (14) exception with no resolution, shutdown status is 00h, resetting
My OS: NasuTek Ensemble http://code.google.com/p/ensemble/
raghuk
Member
Member
Posts: 35
Joined: Tue Jun 30, 2009 2:47 am
Location: Bangalore, India

Re: Triple fault error on page directory swich

Post by raghuk »

Looks like you got a page fault and there is no page fault handler, so it double faulted and there is no double fault handler, and it triple faulted.

Look at the address in CR2. You are trying to access that address but the page table/directory is marked as not present.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Triple fault error on page directory swich

Post by Combuster »

on MemoryManager.cpp line 217 is the code thats causing the triple fault
google wrote:Your search - MemoryManager.cpp package:http://ensemble\.googlecode\.com - did not match any documents.
You might want to fix that problem first :wink:


In the meantime, your pointers seem to be in odd places (stack at some magic address, PD at 0x1000), my crystal ball suggests that you might have "lost" your pagetable somewhere....
You are trying to access that address but the page table/directory is marked as not present.
You can't determine the pagefault type from CR2, you need the error code for that.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
raghuk
Member
Member
Posts: 35
Joined: Tue Jun 30, 2009 2:47 am
Location: Bangalore, India

Re: Triple fault error on page directory swich

Post by raghuk »

You can't determine the pagefault type from CR2, you need the error code for that.
Good catch Combuster. That helped me fix my early version of paging code :-)
DeleteMe
Posts: 8
Joined: Tue Oct 21, 2008 12:22 pm
Location: denmark
Contact:

Re: Triple fault error on page directory swich

Post by DeleteMe »

watch your stack. when you switch PD's you will remove the page under the stack. it will generate a pagefaul, but, becuase it can't push some thing in too the stack, it will pagefault, before, it's pagefault, then you have a doublefault, but you still can't push to the stack, and will pagefault(again), then you will have a fullblown triplefault.

thats my guss.
Post Reply