paging
RE:paging
That looks fine too... Intel's soft_dev_man vol. 3, chapter 5.12 lists a lot of possible reasons for a GPF. Maybe theres a caching problem (not probable, but if you exclude everything impossible, what remains has to be true, even if it's improbable).
Which instruction causes the GPF (just curious)?
BTW: I recommend to disable caching for video RAM as for any kind of memory mapped I/O. Set bit 4 (PCD) of the page table entry.
Which instruction causes the GPF (just curious)?
BTW: I recommend to disable caching for video RAM as for any kind of memory mapped I/O. Set bit 4 (PCD) of the page table entry.
RE:paging
hey guess what! suddenly it all began to work. The PCD bit did not seem to change anything, but it also did not crash.
Thanks for support! Now I'm tracing why stack is walking (lol it eats my variable where I store cr3 so guess what happens: asm("mov %%ebx, %%cr3" : :"b" (_cr3) ))
Cheers,
Adrian.
incl ($0xb8010) - possible, PGT 0 is supervisor only
incl ($0x8000_0000) - both the PGT and PGD is user accesible/writeable. this one used to cause gpf
Thanks for support! Now I'm tracing why stack is walking (lol it eats my variable where I store cr3 so guess what happens: asm("mov %%ebx, %%cr3" : :"b" (_cr3) ))
Cheers,
Adrian.
incl ($0xb8010) - possible, PGT 0 is supervisor only
incl ($0x8000_0000) - both the PGT and PGD is user accesible/writeable. this one used to cause gpf
RE:paging
Never use __asm__. Use __asm__ __volatile__ instead. I it's not true that GCC will optimize your code in __asm__, because it simply doesn't understand it.
When you use only __asm__, GCC will "optimize" your code by removing assembly block from output
You can even write
__asm__ __volatile__("foo %0\n\t"
"bar %1\n\t"
::"r"(test1),"r"(test2));
and GCC won't give any error.
When you use only __asm__, GCC will "optimize" your code by removing assembly block from output
You can even write
__asm__ __volatile__("foo %0\n\t"
"bar %1\n\t"
::"r"(test1),"r"(test2));
and GCC won't give any error.