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.
You're trying to fully fill the page directory, or do a 1:1 mapping of the entire 4 GB. To do this you'd need 1024 page tables, which works out to 4 MB of RAM (everything from 0x0009D000 to 0x0049D000 would be overwritten).
If the last value of 't' is 3 and the last value of 'i' is 1010, then you would've done 4082 page table entries, which means it would've overwritten from 0x0009D000 to 0x000A0FC8 before it stopped. Did the video display go funny?
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
You're trying to fully fill the page directory, or do a 1:1 mapping of the entire 4 GB. To do this you'd need 1024 page tables, which works out to 4 MB of RAM (everything from 0x0009D000 to 0x0049D000 would be overwritten).
If the last value of 't' is 3 and the last value of 'i' is 1010, then you would've done 4082 page table entries, which means it would've overwritten from 0x0009D000 to 0x000A0FC8 before it stopped. Did the video display go funny?
Cheers,
Brendan
Yeah, as you said creating page table entries not completed. But whenever I put a counter in inside loop, it counts up to 3058 (but last value of t is 3, i is 1010). It means the inside loop doesnt count up to 1024 as well. And last pagetable entries addr is not around 0x0049d000. It is around 17Mb. And my screen is not screwed up, it works well.
But..
When I try to allocate memory with malloc function it works good until 30Mb. And if I want to alloc more memory it throws fage fault (What makes me suspect my page initialization function and found this weird things..)
marino wrote:Yeah, as you said creating page table entries not completed. But whenever I put a counter in inside loop, it counts up to 3058 (but last value of t is 3, i is 1010). It means the inside loop doesnt count up to 1024 as well. And last pagetable entries addr is not around 0x0049d000. It is around 17Mb. And my screen is not screwed up, it works well.
But..
When I try to allocate memory with malloc function it works good until 30Mb. And if I want to alloc more memory it throws fage fault (What makes me suspect my page initialization function and found this weird things..)
Out of curiousity, is it possible that your stack is somewhere between 0x0009E000 and 0x000A0000?
In this case you'd be trashing your stack (and the local variables your code is using) before it gets a chance to trash video memory, and before you try to fill the ROM with page table entries...
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.