- Mastering Assembly Programming
- Alexey Lyashko
- 324字
- 2021-08-20 10:23:27
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:

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:

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:

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.
- Mastering Ext JS(Second Edition)
- LabVIEW2018中文版 虛擬儀器程序設計自學手冊
- JavaScript語言精髓與編程實踐(第3版)
- 鋒利的SQL(第2版)
- 零基礎入門學習Python
- 快速念咒:MySQL入門指南與進階實戰
- Python時間序列預測
- RSpec Essentials
- 一本書講透Java線程:原理與實踐
- Java EE企業級應用開發教程(Spring+Spring MVC+MyBatis)
- 后臺開發:核心技術與應用實踐
- 交互式程序設計(第2版)
- Node.js從入門到精通
- Julia High Performance(Second Edition)
- Clojure Polymorphism