3 ms·
Serious question: Why does each level in the page directory get its own name, instead of just being the N'th directory? Also, why count the directories from th
by brandmeyer 6y ago
Serious question: Why does each level in the page directory get its own name, instead of just being the N'th directory?
Also, why count the directories from the bottom instead of the top?
- Veserv 6y agoThey have their own names because Linux was x86 first which had different names for the levels. I do not know why x86 had different names for the levels, but they probably did not notice or care about the generalizability as the exact layout of control bits (read/write permissions, etc) at each level is not fully consistent. They did somewhat realize this in the future as the first depth extension, the addition of the 4th level, has the reasonable name of Level 4 entries. ARM is much better about the naming convention in its documentation and somewhat more consistent with its control bits. You count directories from the bottom because you may need to add another level in future hardware to allow handling greater maximum virtual addresses. Choosing a naming convention where extensions increase in numbering is generally a better idea otherwise you end up with a travesty like x86 privilege level (ring) numbering which used lower numbers (ring 0) for higher privilege, so when they needed a higher privilege level they needed to add ring -1, -2, -3, etc. This also is in contrast to how ARM uses higher numbers for higher privilege (EL{x}), so could add EL2, EL3, etc. when they needed higher levels.