associating page tables with processes and kernel
Posted: Tue Jul 17, 2007 7:45 am
How does everyone associate page tables/directories with their processes and their kernel?
In my kernel, the kernel has a page table that has virtual address 0 to 4MB allocated to physical addresses 0 to 4MB.
My processes each have their own page directory (which can contain up to 1024 pages, but these pages aren't allocated until a process requests them). This page table is mapped to physical addresses 4 to 8MB.
To switch into another process's memory, in my kernel I can do it by:
memory.SetProcessPageTable(myProcess->GetPageTable());
The active process's page table is mapped into position 1 of the page directory and the kernel is always mapped into position 0.
This method is quiet reliable except for the simple fact that a process or the kernel can't be allocated more than 4MB (1 page table worth) of memory.
If your processes can have more than 1 page table associated with them, how have you gotten around this problem?
I thought about each process having a linked list of page tables, except each page table takes up a whole page in itself (this page will have to be allocated in kernel memory - and the kernel only occupies the bottom 4MB (a 1GB process would use up half the kernel's pages))..
In my kernel, the kernel has a page table that has virtual address 0 to 4MB allocated to physical addresses 0 to 4MB.
My processes each have their own page directory (which can contain up to 1024 pages, but these pages aren't allocated until a process requests them). This page table is mapped to physical addresses 4 to 8MB.
To switch into another process's memory, in my kernel I can do it by:
memory.SetProcessPageTable(myProcess->GetPageTable());
The active process's page table is mapped into position 1 of the page directory and the kernel is always mapped into position 0.
This method is quiet reliable except for the simple fact that a process or the kernel can't be allocated more than 4MB (1 page table worth) of memory.
If your processes can have more than 1 page table associated with them, how have you gotten around this problem?
I thought about each process having a linked list of page tables, except each page table takes up a whole page in itself (this page will have to be allocated in kernel memory - and the kernel only occupies the bottom 4MB (a 1GB process would use up half the kernel's pages))..