kd> !pte
VA 00000000
PDE at C0300000 PTE at C0000000
contains 0E474067 contains 00000000
pfn e474 ---DA--UWEV
虛擬位址0x00000000的pte在虛擬位址0xc0000000,pde在虛擬位址0xc0300000,
因為每個pte映射一個頁面,4k,每個pte在pde中佔4個位元組,,這樣要映射全部4gb虛擬位址空間需要4g/4k*4=4m.
給pde分配一個頁面,其中這4k中每4位元組是一個pte的虛擬位址,而pde的這個頁面也需要一個pte(頁表項)來表示,頁表是從0xc0000000開始放置.即地址0x00000000-0x00001000 這4k空間的pte表項存在0xc0000000開始的4位元組中,,這樣,,地址0xc0000000-0xc0001000的頁表項放在0xc0300000開始的4位元組中,,,所以這一個也表項正是pde所用的頁,,,pde選在0xc0300000是有道理的 :>
通過pde找到第一個頁表,也就找到了虛擬4g地址空間的開始
相關的一些
if paged pool expansion requires the allocation of a new system page table, the memory manager doesn't go back and update all the process page directories to point to the new system page table. Instead, it updates the process page directories when the processes reference the new virtual address.
Thus, a process can take a page fault when referencing paged pool that is in fact physically resident because its process page directory doesn't yet point to the new system page table that describes the new area of pool. Page faults don't occur when accessing nonpaged pool, even though it too can be expanded, because Windows 2000 builds enough system page tables to describe the maximum size during system initialization.