Skip to content

Commit

Permalink
Fix for insufficient identity mapped memory
Browse files Browse the repository at this point in the history
- Highest LFB address as of now has been `0x000000FCE0000000`
- Pure64 now creates 1024 GiB of identity mapped memory instead of 512 GiB
  • Loading branch information
Ian Seyler committed Oct 9, 2024
1 parent d20e48b commit 2907e2c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/pure64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,16 @@ pde_low: ; Create a 2MiB page
; PDPTE is stored at 0x0000000000003000, create the first entry there
; A single PDPTE can map 1GiB
; A single PDPTE is 8 bytes in length
; 512 entries are created to map the first 512GiB of RAM
; 1024 entries are created to map the first 1024GiB of RAM
pdpte_1GB:
mov ecx, 512 ; number of PDPE's to make.. each PDPE maps 1GiB of physical memory
mov edi, 0x00003000 ; location of low PDPE
; Overwrite the original PML4 entry for physical memory
mov edi, 0x00002000 ; Create a PML4 entry for physical memory
mov eax, 0x00010003 ; Bits 0 (P), 1 (R/W), location of low PDP (4KiB aligned)
stosq
add eax, 0x1000
stosq
mov ecx, 1024 ; number of PDPE's to make.. each PDPE maps 1GiB of physical memory
mov edi, 0x00010000 ; location of low PDPE
mov eax, 0x00000083 ; Bits 0 (P), 1 (R/W), 7 (PS)
pdpte_low_1GB: ; Create a 1GiB page
stosq
Expand Down

0 comments on commit 2907e2c

Please sign in to comment.