I am thinking of implementing a heap allocator on top of virtual memory manager. However I am wonderingif it is possible to access the virtual memory manager only through the interface. The function provided the VMM to allocate a page is

But this takes a pt_entry which means that any other kernel code which wants to use the services the VMM will have todirectly access the Page Directory to get the pt_entry first and then call this function. Though this is not a big issue and I can write another function which takes a virtual address and retrieves the pt_entry itself but I just want to confirm if that is the only option.

The VMM designed for the series is over-complicated in this regard. It would be more beneficial to allocate a region and map it into the address space for the heap allocator to use. The VMM provided by the series includes a function that allocates the pages automatically - virMemMgr_MapPage - which can be used to map any physical address to a virtual address. With this in mind, we can allocate a continuous region of physical memory using pmmngr_alloc_blocks and then map the region with virMemMgr_MapPage to be used as heap memory. Your heap allocator can work with the heap memory.

To summarize, you could allocate a region calling pmmngr_alloc_blocks and then map the region (by looping) by calling virMemMgr_MapPage which can be your heap.

are using the physical address of page table as its virtual address. I guess this is under the assumption thatmemory area occupied by the page table is identity-mapped. Am I right ?Also, I am wondering if this can cause problem at some point of time because not all the memory is identity-mapped.