CLI Utility to Calculate Indices for Page Tables
I just want to drop a short notice that I created a small CLI utility that I think is helpful.
paging-calculator helps you to calculate the indices for a given virtual address that are used for the physical address lookup at different page table levels. Paging is a mechanism that operating systems use for memory management.
It works as shown in the following screenshot:
For x86, there are (at least?) four different paging modes: 32-bit paging, 32-bit paging with PAE, 64-bit 4-level paging (nowadays the most common one) and 64-bit 5-level paging (relatively new). So far, my utility only covers regular 32-bit and regular 64-bit paging. However, I plan to extend my utility and I think that it is even very useful in the current state.
I was working on OS-related topics and wanted to set up a page table from assembly code. As I had some trouble, I tried to understand how everything works. In the end, I created this utility.