Skip to content

Commit 2907e2c

Browse files
author
Ian Seyler
committed
Fix for insufficient identity mapped memory
- Highest LFB address as of now has been `0x000000FCE0000000` - Pure64 now creates 1024 GiB of identity mapped memory instead of 512 GiB
1 parent d20e48b commit 2907e2c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/pure64.asm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,16 @@ pde_low: ; Create a 2MiB page
314314
; PDPTE is stored at 0x0000000000003000, create the first entry there
315315
; A single PDPTE can map 1GiB
316316
; A single PDPTE is 8 bytes in length
317-
; 512 entries are created to map the first 512GiB of RAM
317+
; 1024 entries are created to map the first 1024GiB of RAM
318318
pdpte_1GB:
319-
mov ecx, 512 ; number of PDPE's to make.. each PDPE maps 1GiB of physical memory
320-
mov edi, 0x00003000 ; location of low PDPE
319+
; Overwrite the original PML4 entry for physical memory
320+
mov edi, 0x00002000 ; Create a PML4 entry for physical memory
321+
mov eax, 0x00010003 ; Bits 0 (P), 1 (R/W), location of low PDP (4KiB aligned)
322+
stosq
323+
add eax, 0x1000
324+
stosq
325+
mov ecx, 1024 ; number of PDPE's to make.. each PDPE maps 1GiB of physical memory
326+
mov edi, 0x00010000 ; location of low PDPE
321327
mov eax, 0x00000083 ; Bits 0 (P), 1 (R/W), 7 (PS)
322328
pdpte_low_1GB: ; Create a 1GiB page
323329
stosq

0 commit comments

Comments
 (0)