Page 1 of 1
sbrk()
Posted: Sun Apr 27, 2003 4:58 pm
by shad
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()
Posted: Sun Apr 27, 2003 5:09 pm
by Tim
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.
It's up to you. That's a design decision which depends on your kernel.
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..
Firstly, you've
got to allocate a new page table, even if there's only one page mapped there.
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.
Re:sbrk()
Posted: Sun Apr 27, 2003 5:16 pm
by shad
hmm.. i see, but what i meant was i wouldnt want to allocate a new table if there was already one there. And i think ill let the page fault handler map it.. But thanks for all your help i think i know what to do... OFF TO THE RACES