Paging Memory problems

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
Sardak

Paging Memory problems

Post by Sardak »

Ok, I'm new here, but I did search thoroughly for anything related to my problem, not only here but everywhere I cound find related to the subject of operating system development. I've been trying to figure this one out for a few days now, and I've come to a dead end.

I'm setting up my memory manager for my kernel, and I have my GDT setup, and I was able to enable the first 4MB of memory in paging. I'm trying to extend this, but it's not working. Here's exactly what I've tracked it down to.

When I write the page table entry for a page of memory, nothing is actually written. I can read it back on the next line of code, and it's 0x00000000. I've verified the value that's being used to write it, and it's correct. I can't for the life of me figure out WHY it won't maintain the memory I'm writing. I haven't even added this set of pages to the directory yet.

Anyone have any suggestions? As I said, I've exhausted all my ideas. I'd just like to get this working so I can continue development on other aspects of the kernel.
Adek336

Re:Paging Memory problems

Post by Adek336 »

Welcome to MT ;)
This seems familiar. I remember I used to write memory and then reread however the value never changed.. if I only remembered what was the problem :P
One thing which comes to mind.. the page table isn't placed into the 0xa0000-0x100000 area? Prob'bly not..
Don't be shy, post some code ;)

Cheers,
Adrian.
Sardak

Re:Paging Memory problems

Post by Sardak »

That was exactly it. Thank you!

I had my page tables rooted at 0x9c000 (that was the example address given in a document I was referencing, and I never bothered to change it.) Once it got a few tables in, it overflowed into the 0xa0000 region. I never noticed anything, because I'm not using a graphics mode, yet. Just updated my code, and it works flawlessly. Again, thank you!

p.s. I just realized one of my references is a copy of your kernel I stumbled upon last week. :)
Post Reply