972
edits
[unchecked revision] | [unchecked revision] |
No edit summary |
m (Bot: Replace deprecated source tag with syntaxhighlight) |
||
(8 intermediate revisions by 7 users not shown) | |||
Line 1:
Identity Paging, Identity Mapped
==Advantages==
▲Identity Paging, Identity Mapped paging and 1:1 paging are terms often used on the forum to describe a design choice where a portion of [virtual addresses|Physical, Virtual, Paging, help?!?] are mapped to physical addresses that have the same value.
When switching to paged protected mode, your 1:1 mapping region doesn't care of whether paging is enabled or disabled. Placing your switching code and important data such as the core page directory and a few system page tables in this region gives you an easier way to set up paging without headaches.▼
==Example==
You can easily do this with a loop filling the page table:
<syntaxhighlight lang="c">
void idpaging(
from = from & 0xfffff000; // discard bits we don't want▼
▲ from = from & 0xfffff000; // discard bits we don't want
*first_pte = from | 1; // mark page present.▼
▲ for(;size;from+=4096,first_pte++) {
}
▲ *first_pte=from|1; // mark page present.
</syntaxhighlight>
==See Also==
===Articles===
* [[Memory Management]]
* [[Paging]]
[[Category:Memory management]]
▲When switching to paged protected mode, your 1:1 mapping region doesn't care of whether paging is enabled or disabled. Placing your switching code and important data such as the core page directory and a few system page tables in this region gives you an easier way to set up paging without headaches.
|