Get the latest tech news
Making an RISC-V OS (Part 3): Managing free memory
previous part on handling the transition from physical to virtual memory. When we left last time our kernel had booted up in virtual memory, but we still had no idea what our surroundings looked like.
Device trees are a data structure that is populated by a low-level firmware (or it could even be hard-coded somewhere in the address-space) that contain all the information on the system. All those restrictions make the code a bit more complex than it seems with the description, so I won't show include the parsing function in this post, but it is available on the git repository This allows us to ensure that while we hold the lock we can be sure that there can't be another user that can access unallocated pages, and as such it is safe to take a (single!)
Or read this on Hacker News