9462df03e786312b6ce197cf56113d411412cbb2
Currently, this uses a relatively naive method of simply scanning the 512 entries for the PRESENT flag. But, unless the optimizer cannot, it can be reduced to calculating the bitwise OR of every entry and then checking that. If this turns out to be too slow, which it might be when unmapping lots of pages, then we can (1) either fall back to using a counter like the old paging code did, or even better (2) use the now-1:1 grants tree to check if it became empty. Putting the grants code in RMM might be suboptimal, so instead we can add "unmap_range" and have the kernel paging code take the offset of the next grant, if any, and then possibly unmap entire P1s/P2s/P3s -- whatever is in the page tables within that range. Note that I am fairly certain that method (1) was the cause of the visually notorious orbital memory corruption bug.
Redox Memory Management
This is a Rust crate to provide abstractions for hardware memory management. It also contains a mechanism for testing memory management with software emulation.
Description
RedBear Operating System, based on RedoxOS. Licenced under MIT license.
https://redbearos.org
Languages
Rust
99.6%
Linker Script
0.2%
Makefile
0.1%
Shell
0.1%