diff options
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/startup-x86_64.s | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/boot/startup-x86_64.s b/boot/startup-x86_64.s index a8b44c2..fb65a71 100644 --- a/boot/startup-x86_64.s +++ b/boot/startup-x86_64.s @@ -56,6 +56,15 @@ init_longmode: mov cr4, eax setup_paging: + + ; zero out the initial page tables (2 pages in total) + mov edi, pml4 +clear_pt: + mov byte [edi], 0 + inc edi + cmp edi, pt_end + jne clear_pt + ; Provisional identical page mapping, using 1G huge page, therefore only 2 ; table levels needed. see docs/x86_paging.txt @@ -186,7 +195,7 @@ pml4: pdp: resb 4096 alignb 4096 - +pt_end: ; reserve 8MiB for frame alloc. ; (see linker file) [SECTION .global_free_page_stack] |
