Triple fault on switching page directory

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
LPeter
Member
Member
Posts: 30
Joined: Wed Jan 28, 2015 7:41 am

Triple fault on switching page directory

Post by LPeter »

First I've made a page directory and enabled paging. That went fine, paging works. Now I'm trying to clone directories. I've cloned the kernel directory and tried to switch to the cloned one but the system triple faults. Here's the dump:

Code: Select all

CS.mode = 32 bit
SS.mode = 32 bit
EFER   = 0x00000000
EAX=00002000  EBX=c0100000  ECX=00000300  EDX=0010a080
ESP=0010e588  EBP=0010e5d0  ESI=00106fef  EDI=00000000
OPL=0 ID vip vif ac vm RF nt of df if tf sf zf AF PF cf
SEG sltr(index|ti|rpl)     base    limit G D
CS:0008( 0001| 0|  0) 00000000 ffffffff 1 1
DS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
SS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
ES:0010( 0002| 0|  0) 00000000 ffffffff 1 1
FS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
GS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
EIP=001035fd (001035fd)
CR0=0xe0000011 CR2=0x001090c0
CR3=0x00002000 CR4=0x00000000
CR3 is page aligned (but is suspiciously a low value). Could that mean that my cloned page directory is not valid? If I just clone the directory without enabling paging and just switch straight to the cloned one it works fine.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Triple fault on switching page directory

Post by iansjack »

You set CR3 so you should know whether it's the correct value or not. Is it the physical address of your cloned table?
LPeter
Member
Member
Posts: 30
Joined: Wed Jan 28, 2015 7:41 am

Re: Triple fault on switching page directory

Post by LPeter »

iansjack wrote:You set CR3 so you should know whether it's the correct value or not. Is it the physical address of your cloned table?
This is really weird. Because I've started debugging the problem. And I don't do anything else just print out the physical address of the table. And sometimes it's 0x2000 but others it's 0x115000. I really don't change anything in the code just recompile or move some printf functions.
Post Reply