add: documentation: memory

This commit is contained in:
2024-10-30 19:05:58 +01:00
parent 5fba376e2f
commit 04211e2773
9 changed files with 134 additions and 65 deletions

View File

@ -0,0 +1,19 @@
# Memory Management Unit (MMU)
The MMU is a chip which translate virtual memory to physical memory. When you try to access to an address (/!\ only when you try to access) the MMU will get the physical address from the [pd](./page_directory.md).
## How translate an address ?
The address will be divid in 3 parts:
- Page Directory index (10bit (cause 1024))
- Page Table index (10bit (cause 1024 too))
- offset (12bit cause page size = 4096)
### Example
**address**: 0b000100000011101011111011101101
| Base | PD index | PT index | offset |
|--------|----------|------------|--------------|
| Binary | 00010000 | 0011101011 | 111011101101 |
| Decimal| 16 | 235 | 3821 |
So to translate this address the MMU will get the 20 first bit of the value store at the 235th PTE of the 16th PDE and will replace the 20 first bit of the virtually address.