Recursive Page Directory Help
Posted: Sat Oct 31, 2009 9:29 pm
So, it's been a while since I've last needed help with anything, but now I'm stuck. I'm trying to use the recursive page directory mapping technique and am a little confused with how it works. Here's the basic code I'm using right now (u32 is typedef'ed to unsigned int for now):
tableIndex and pageIndex are used like MAPPING[index].
How wrong am I?
I am a terrible coder since I couldn't for the life of me explain why I am using those values. I didn't even get them from a tutorial. I think I just kind of guessed at something that feels about right based on other code, which is probably why it's broken.
It's about 10:30 P.M. here, so if it ends up being something obvious or easily figured out my excuse is being tired. Thank you for your time and help!
Edit: Fixed tableIndex to use proper value
Code: Select all
MAPPING = ((u32*)(0xFFC00000));
tableIndex = 0xFFC00 + addr >> 22;
pageIndex = addr >> 10;
How wrong am I?
I am a terrible coder since I couldn't for the life of me explain why I am using those values. I didn't even get them from a tutorial. I think I just kind of guessed at something that feels about right based on other code, which is probably why it's broken.
It's about 10:30 P.M. here, so if it ends up being something obvious or easily figured out my excuse is being tired. Thank you for your time and help!
Edit: Fixed tableIndex to use proper value