Skip to content

Commit c3f4b08

Browse files
committed
Explain how pagination and address translation work
1 parent 2b3a11f commit c3f4b08

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Chapter-8/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ In a paged system, each process may execute in its own 4gb area of memory, witho
1616

1717
![Processes memories](./processes.png)
1818

19+
#### How does it work?
20+
21+
The translation of a linear address to a physical address is done in multiple steps:
22+
23+
1. The processor use the registry `CR3` to know the physical address of the pages directory.
24+
2. The first 10 bytes of the linear address represent an offset (between 0 and 1023), pointing to an entry in the pages directory. This entry contains the physical address of a pages table.
25+
3. the next 10 bytes of the linear address represent an offset, pointing to an entry in the pages table. This entry is pointing to a 4ko page.
26+
4. The last 12 bytes of the linear address represent an offset (between 0 and 4095), which indicates the position in the 4ko page.
27+

0 commit comments

Comments
 (0)