官术网_书友最值得收藏!

Protected mode - paging

Paging is a more convenient memory management scheme introduced in 80386 and has been a bit enhanced since then. The idea behind paging is memory virtualization--this is the mechanism that makes it possible for different processes to have the same memory layout. In fact, the addresses we use in pointers (if we are writing in C, C++, or any other high-level language that compiles into native code) are virtual and do not correspond to physical addresses. The translation of a virtual address into a physical address is implemented in hardware and is performed by the CPU (however, some operating system interventions are possible).

By default, a 32-bit CPU uses a two-level translation scheme for the derivation of a physical address from the supplied virtual one.

The following table explains how a virtual address is used in order to find a physical address:

Table 3: Virtual address to physical address translation

Most, if not all, modern processors based on the Intel architecture also support Page Size Extension (PSE), which makes it possible to use the so-called large pages of 4 MB. In this case, the translation of a virtual address into a physical address is a bit different, as there is no page table any more. The following table shows the meaning of bits in a 32-bit virtual address:

Table 4: Virtual address to physical address translation with PSE enabled

Furthermore, the Physical Address Extension (PAE) was introduced, which significantly changes the scheme and allows access to a much bigger range of memory. In protected mode, PAE adds a page directory pointer table of four entries and the virtual to physical address conversion would be as per the following table:

Table 5: Virtual to physical address translation with PAE enabled (no PSE)

Enabling PSE in addition to PAE forces each entry in the page directory to point directly to a 2 MB page instead of an entry in a page table.

主站蜘蛛池模板: 安吉县| 衡南县| 霍山县| 宁陕县| 天长市| 玛曲县| 西城区| 莱阳市| 沂南县| 扎赉特旗| 武安市| 汝城县| 循化| 大安市| 承德县| 建德市| 武山县| 云浮市| 昌黎县| 平乐县| 图片| 洛宁县| 略阳县| 中超| 封丘县| 临夏县| 图木舒克市| 淮阳县| 甘洛县| 灵山县| 当阳市| 靖西县| 重庆市| 县级市| 达孜县| 从江县| 麻江县| 桂阳县| 岳西县| 饶河县| 开鲁县|