sbrk()
sbrk()
Should sbrk() perform the mapping of physical memory or just extend the heap pointer and let the page fault handler do the mapping. Also, lets say your in the page fault handler, and memory was accessed that a whole table doesnt exist for, how can you tell if it was because there was no table or no page, because i wouldnt want to map a whole new table just for one page..
Re:sbrk()
It's up to you. That's a design decision which depends on your kernel.shad wrote:Should sbrk() perform the mapping of physical memory or just extend the heap pointer and let the page fault handler do the mapping.
Firstly, you've got to allocate a new page table, even if there's only one page mapped there.Also, lets say your in the page fault handler, and memory was accessed that a whole table doesnt exist for, how can you tell if it was because there was no table or no page, because i wouldnt want to map a whole new table just for one page..
It's easy to check whether the fault occurred because there was no page table present: just look up the PDE for the fault address and check the present bit.