aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/src/kernel')
-rw-r--r--arch/x86_64/src/kernel/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp
index c111f22..ea1a157 100644
--- a/arch/x86_64/src/kernel/main.cpp
+++ b/arch/x86_64/src/kernel/main.cpp
@@ -2,6 +2,7 @@
#include "arch/exception_handling/assert.hpp"
#include "arch/memory/allocator/area_frame_allocator.hpp"
+#include "arch/memory/cpu/msr.hpp"
#include "arch/memory/multiboot/reader.hpp"
#include "arch/memory/paging/kernel_mapper.hpp"
#include "arch/memory/paging/temporary_page.hpp"
@@ -20,6 +21,9 @@ namespace teachos::arch::kernel
auto const memory_information = memory::multiboot::read_multiboot2();
memory::allocator::area_frame_allocator allocator(memory_information);
+ memory::cpu::set_cr2_bit(memory::cpu::cr2_flags::WRITE_PROTECT);
+ memory::cpu::set_efer_bit(memory::cpu::efer_flags::NXE);
+
memory::paging::kernel_mapper kernel(allocator, memory_information);
kernel.remap_kernel();
video::vga::text::write("Kernel remapping successfull", video::vga::text::common_attributes::green_on_black);