writing morecore
Posted: Mon Aug 13, 2007 9:43 pm
Hi i am working on my memory manager. I want to confirm that what I have understood is correct. So here it goes (only for kernel heap mapped to E0000000)
physical allocator
void * allocate() /*decrement stack pointer and return physical page address
void deallocate()
/*this is where i need more info. What exactly are the responsibilities of morecore.How does it work??*/
/*For now I am assuming this
1) in teh kernel page directory, find currently used entry for 0xE0000000 and beyond
2)Within the corresponding page table , if there is an entry free, call allocate of physical allocator, map the address and return virtual address
3)if no space available in the page table call allocate , insert new pagetable, then call allocate for another page(or as many times required by the argument) and perform mapping. Then return virtual address of first page .
Is this correct?????
void *morecore(nbytes)
physical allocator
void * allocate() /*decrement stack pointer and return physical page address
void deallocate()
/*this is where i need more info. What exactly are the responsibilities of morecore.How does it work??*/
/*For now I am assuming this
1) in teh kernel page directory, find currently used entry for 0xE0000000 and beyond
2)Within the corresponding page table , if there is an entry free, call allocate of physical allocator, map the address and return virtual address
3)if no space available in the page table call allocate , insert new pagetable, then call allocate for another page(or as many times required by the argument) and perform mapping. Then return virtual address of first page .
Is this correct?????
void *morecore(nbytes)