An Intro to Kernel Development - MMU - Part 6

5 mins

Let's see how to parse DTB

In the previous blog we finished of with jumping into the VA. now we need create an helper function that can allocate new pages for us, ie lets say user space or kernel method was extra space, we need to add need entries in the page table and return the address we only have limited physical ram, and every user process or kernel process might wanna try and allocate new memory. we need a data structure that will keep track of the pages in PA that are currently in use, so we need allocate new pages for the new comers. to start that, we need to know the total physical memory that is current available, this information is present in the DTB region in qemu setup at memory 0x40000000 we need to parse this DTB and get the total memory. i have streamed the debugging session where i go about how we can parse the DTB and get the total memory size.