Virtual Memory Allocator
Posted: Sat Dec 28, 2002 8:27 am
I have built my own physical memory allocator that uses a two bitmaps (for superpage and pages) to allocate and return physical addresses. Paging is also enabled, but now I wonder how I can implement my virtual memory manager (used by the kernel, not by users yet), like *morecore() or sbrk() that allocate memory from the heap - you know what I mean.
Does anybody have an idea how to implement this. If my kernel allocates (virtual) memory by using malloc() for example, three steps are done:
1. Allocate memory in the physical address space using the physical page frame allocator
2. Allocate memory in the virtual address space
3. Map physical addresses to virtual addresses
I've implemented step 1, but I'm wondering how to implement step 2 and 3.
So, has anybody some information/ideas/code/suggestions or anything else about that?
best regards,
A. Blessing
Does anybody have an idea how to implement this. If my kernel allocates (virtual) memory by using malloc() for example, three steps are done:
1. Allocate memory in the physical address space using the physical page frame allocator
2. Allocate memory in the virtual address space
3. Map physical addresses to virtual addresses
I've implemented step 1, but I'm wondering how to implement step 2 and 3.
So, has anybody some information/ideas/code/suggestions or anything else about that?
best regards,
A. Blessing