fix: identity-map first 4 GiB to cover framebuffer MMIO
Co-authored-by: aider (openrouter/anthropic/claude-opus-4.7) <aider@aider.chat>
This commit is contained in:
+12
-3
@@ -34,7 +34,7 @@ pml4:
|
||||
pdpt:
|
||||
.space 4096
|
||||
pd:
|
||||
.space 4096
|
||||
.space 4096 * 4
|
||||
|
||||
.align 16
|
||||
stack_bottom:
|
||||
@@ -64,13 +64,22 @@ _start:
|
||||
orl $0x03, %eax
|
||||
movl %eax, pml4
|
||||
|
||||
/* Populate 4 PDPT entries, each pointing to one of 4 PDs.
|
||||
* This identity-maps the first 4 GiB using 2 MiB pages,
|
||||
* which covers typical framebuffer/MMIO regions. */
|
||||
movl $pd, %eax
|
||||
orl $0x03, %eax
|
||||
movl %eax, pdpt
|
||||
movl %eax, pdpt + 0
|
||||
addl $4096, %eax
|
||||
movl %eax, pdpt + 8
|
||||
addl $4096, %eax
|
||||
movl %eax, pdpt + 16
|
||||
addl $4096, %eax
|
||||
movl %eax, pdpt + 24
|
||||
|
||||
movl $0x00000083, %eax
|
||||
movl $pd, %edi
|
||||
movl $512, %ecx
|
||||
movl $2048, %ecx
|
||||
1:
|
||||
movl %eax, (%edi)
|
||||
addl $0x200000, %eax
|
||||
|
||||
Reference in New Issue
Block a user