How to implement Dynamically Growing Heap

2019-09-11 07:07发布

问题:

Finished implementing the minimal Heap structure with awesome help from Micheal . Right now I have one thing missing so it dynamically grows. As you can see in this image, it isn't dynamic:

Instead of having a fixed size when I do pmm_map_physical_virtual(0x800000,0xC0800000), the max I can go to is 8MB which is from 0xC00000000-0xC0800000 ... but then I have to be aware not to overwrite the kernel, so I will technically have less than 8MB . Is there a way so that the heap just continues from the end of the kernel and grows dynamically? They said this is what I was missing from my memory management. And is this a good idea to do this?