VMM: How do I allocate the structure used for storing VMAs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
d4ilyrun
Posts: 3
Joined: Fri Feb 16, 2024 9:00 am
Location: France

VMM: How do I allocate the structure used for storing VMAs

Post by d4ilyrun »

Hello guys,

I'm writing my first kernel and I got to the point of implementing the memory manager.
Right now I have a working PMM as well as an interface around the MMU (map/unmap a given virtual address to a given physical page).

I'm now trying to write the Virtual Address Allocator. From what I gathered, the better solution is to have two AVL trees, each containing memory areas and their information and respectively sorted by address and size.
But my question is the following: how do I allocate the nodes that go inside these trees?

I do not have a way to use dynamic memory yet (no kernel heap), and used a static bitmap for my PMM, but i cannot statically allocate the whole tree this time around.

Thank you in advance for your advice !
Post Reply