Skip to content

Commit

Permalink
fix: paging address space calculation (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
malletgaetan authored Sep 9, 2024
1 parent 8969dac commit 68726ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 04_Memory_Management/03_Paging.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ If we are using 2MB pages this is how the address will be handled by the paging
* Bits 29 ... 21 are the PD entry.
* Offset in the page directory.
Every table has 512 elements, so we have an address space of $2^{512}*2^{512}*2^{512}*0x200000$ (that is the page size)
Every table has 512 elements, so we have an address space of $512*512*512*0x200000$ (that is the page size)
### Address translation Using 4KB Pages
Expand All @@ -246,7 +246,7 @@ If we are using 4kB pages this is how the address will be handled by the paging
* Offset in the page table.
Same as above:
Every table has 512 elements, so we have an address space of: $2^{512}*2^{512}*2^{512}*2^{512}*0x1000$ (that is the page size)
Every table has 512 elements, so we have an address space of: $512*512*512*512*0x1000$ (that is the page size)
## Page Fault
Expand Down
1 change: 1 addition & 0 deletions 99_Appendices/I_Acknowledgments.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ In no particular order:
- @AnErrupTion ([https://github.com/AnErrupTion](https://github.com/AnErrupTion))
- @MRRcode979 ([https://github.com/MRRcode979](https://github.com/MRRcode979))
- @Hqnnqh ([https://github.com/Hqnnqh](https://github.com/Hqnnqh))
- @malletgaetan ([https://github.com/malletgaetan](https://github.com/malletgaetan))

0 comments on commit 68726ca

Please sign in to comment.