What is the best way to allocate physical memory to be used by page directories and tables? And how do I make it not to collide with my other physical allocation routine (a stack)?
Are the addresses in a page directory virtual or physical?
If they're virtual, I can just allocate 4kb virtual memory to be used by the page dir, and when I map a page I create a new page table if needed (allocating virtual memory for it). But then there's a problem, how do I map a page when there is no page table?
And another problem, all those virtual addresses used by the page dir are mapped in another process' address space (the kernel's), so I would have to use the kernel's address space when I map something. Or, should I create a shared memory region with all the page dir -> page table mappings, and then have a special heap, only to be used to allocate virtual memory for page dirs/tables?
Many questions, but I would really like some of them answered
Physical memory allocation
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Physical memory allocation
i guess you should get a look at the FAQ first, and at this page too.
Directory and tables does not *allocate* pages: they assign physical addresses to virtual addresses.
Maybe you could rephrase that after reading the above-mentionned pages ?
Directory and tables does not *allocate* pages: they assign physical addresses to virtual addresses.
Sorry, i just get the feeling you're completely confused about the whole thing, but i cannot figure what troubles you nor how you'd like to fix it ...And another problem, all those virtual addresses used by the page dir are mapped in another process' address space (the kernel's), so I would have to use the kernel's address space when I map something. Or, should I create a shared memory region with all the page dir -> page table mappings, and then have a special heap, only to be used to allocate virtual memory for page dirs/tables?
Maybe you could rephrase that after reading the above-mentionned pages ?
Re:Physical memory allocation
Sorry for that mess...
I think my problem was that I somehow thought the addresses contained in page directory entries were virtual addresses... heh
Pype, I've got a question about Clicker I'm quite interested in your system KDS, do you have any docs where I can read a little about the concept?
I think my problem was that I somehow thought the addresses contained in page directory entries were virtual addresses... heh
Pype, I've got a question about Clicker I'm quite interested in your system KDS, do you have any docs where I can read a little about the concept?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Physical memory allocation
http://clicker.sourceforge.net/wiclicker/index.php/KDS should collect everything i have available ... If you need more precisions, feel free to bug me on ICQ