How to build and organize Mem management over 1GiB phy. mem?
Posted: Tue Jun 30, 2020 3:06 pm
Hi, I'm new osdever. And now I have already built a simple kernel support physic memory management by using buddy system.
And when I learnt some practical impelements for virtual memory management and paging, I found that most of those kernel only support less than 1GiB memory.
They mimic linux and map kernel address space to 0xC0000000. In such size less than 1 GiB, such as 256MiB or 896MiB, it is easy to map all address space from 0xC0000000 to 0xFFFFFFFF, and kernel can easily access whole memory space.
And now I find a problem in my kernel dev. Because I build a buddy system which can manage memory size up to 4GiB, and it will return physical address. If I follow such rule above, I can only use up to 1GiB memory even the physical memory is over 1GiB.
How can a good design to manage those unmapped memory over 1GiB? And if my function such as return a physical address, will the MMU automatically translate it to virtual address? If not, how to fix it?
Thank you very much!
And when I learnt some practical impelements for virtual memory management and paging, I found that most of those kernel only support less than 1GiB memory.
They mimic linux and map kernel address space to 0xC0000000. In such size less than 1 GiB, such as 256MiB or 896MiB, it is easy to map all address space from 0xC0000000 to 0xFFFFFFFF, and kernel can easily access whole memory space.
And now I find a problem in my kernel dev. Because I build a buddy system which can manage memory size up to 4GiB, and it will return physical address. If I follow such rule above, I can only use up to 1GiB memory even the physical memory is over 1GiB.
How can a good design to manage those unmapped memory over 1GiB? And if my function such as
Code: Select all
alloc_page_frame()
Thank you very much!