ELF Loading: Page Mapping
Posted: Fri Oct 10, 2008 2:47 am
Hi everyone,
Just found a little bit of spare time in between assignment and exams and am going back over some ELF code I have trying to make it better. I've noticed a lot of calls like this:
Basically, mapping in the page into the new address space, and also into the parent space to be able to copy data to the area.
Is it plausible to switch page directories when creating a new task and avoid this mapping mess? I know for sure caches will be a problem with switching the page directories, but is switching a better way than what I'm doing now? Thanks in advance!
Just found a little bit of spare time in between assignment and exams and am going back over some ELF code I have trying to make it better. I've noticed a lot of calls like this:
Code: Select all
MapPage( newcr3, prghdrs[i].p_vaddr + (0x1000 * z), ((uint32_t) secptr) + (0x1000 * z), pageflags );
MapPage( 0xfffff000, 0xf2000000 + (0x1000 * z), ((uint32_t) secptr) + (0x1000 * z), PF_PRESENT | PF_READWRITE | PF_USER | PF_KERNELPAGE );
Is it plausible to switch page directories when creating a new task and avoid this mapping mess? I know for sure caches will be a problem with switching the page directories, but is switching a better way than what I'm doing now? Thanks in advance!