Kernel: Enable Write Protect. This seems to be good for security
This commit is contained in:
parent
130a69bac6
commit
6ef153b6ca
|
@ -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