From 8eb68ccb8837ba867550d16f967d9ef21921abe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Sun, 10 Nov 2024 12:08:02 +0000 Subject: Finish control register and adjust msr --- arch/x86_64/src/kernel/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/x86_64/src/kernel/main.cpp') 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); -- cgit v1.2.3