Kernel: Paging is now enabled by boot.S

This commit is contained in:
Bananymous 2023-01-10 17:53:29 +02:00
parent ee83cd3430
commit 181478119e
2 changed files with 7 additions and 3 deletions

View File

@ -32,6 +32,13 @@ namespace Paging
if (!HasRequirements())
asm volatile("hlt");
// Disable paging
asm volatile(
"movl %cr0, %ebx;"
"andl $0x7fffffff, %ebx;"
"movl %ebx, %cr0;"
);
// Identity map first 2 (2 MiB) pages
memset(s_page_directory, 0x00, sizeof(s_page_directory));
s_page_directory[0] = (0x00 << 21) | PAGE_SIZE | READ_WRITE | PRESENT;

View File

@ -42,8 +42,6 @@
boot_page_directory1:
.skip 512 * 8
.section .text, "a"
.global g_multiboot_info
@ -84,7 +82,6 @@ _start:
movl %eax, g_multiboot_magic
movl %ebx, g_multiboot_info
# Copy kernel command line to known location
movl %ebx, %esi
addl $16, %esi