forked from Bananymous/banan-os
Kernel: Enable Write Protect. This seems to be good for security
This commit is contained in:
parent
5d34cebeca
commit
8a10853ba7
|
@ -92,6 +92,13 @@ namespace Kernel
|
||||||
s_has_pge = true;
|
s_has_pge = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// enable write protect to kernel
|
||||||
|
asm volatile(
|
||||||
|
"movq %cr0, %rax;"
|
||||||
|
"orq $0x10000, %rax;"
|
||||||
|
"movq %rax, %cr0;"
|
||||||
|
);
|
||||||
|
|
||||||
ASSERT(s_kernel == nullptr);
|
ASSERT(s_kernel == nullptr);
|
||||||
s_kernel = new PageTable();
|
s_kernel = new PageTable();
|
||||||
ASSERT(s_kernel);
|
ASSERT(s_kernel);
|
||||||
|
|
Loading…
Reference in New Issue