CR3 Question

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
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

CR3 Question

Post by Lprogster »

...

Thanks,
Lster
Last edited by Lprogster on Tue Oct 23, 2007 11:17 am, edited 2 times in total.
INF1n1t
Member
Member
Posts: 60
Joined: Fri Dec 22, 2006 5:32 pm
Location: Somewhere Down...

Post by INF1n1t »

Code: Select all


write_cr3:
   mov eax, [esp + 8]
   mov cr3, eax
   ret

...should be...

[esp+4], because ESP points to the Return address of your procedure. ESP+4 points to the parameter, pushed before calling the procedure.

It was [esp+8], because you pushed ebp, so ESP was decremented by four one more time ;)
I think, I have problems with Bochs. The biggest one: Bochs hates me!
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

:oops: Hehe that is a very silly mistake... How could I manage that... - too much programming?

Cheers
Lster
Post Reply