Kernel: Enable Write Protect. This seems to be good for security

This commit is contained in:
Bananymous 2023-10-30 12:23:22 +02:00
parent 5d34cebeca
commit 8a10853ba7
1 changed files with 7 additions and 0 deletions

View File

@ -92,6 +92,13 @@ namespace Kernel
s_has_pge = true;
}
// enable write protect to kernel
asm volatile(
"movq %cr0, %rax;"
"orq $0x10000, %rax;"
"movq %rax, %cr0;"
);
ASSERT(s_kernel == nullptr);
s_kernel = new PageTable();
ASSERT(s_kernel);