diff --git a/kernel_entry.S b/kernel_entry.S index bc12232..5468683 100644 --- a/kernel_entry.S +++ b/kernel_entry.S @@ -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