diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-11-10 12:08:02 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-11-10 12:08:02 +0000 |
| commit | 8eb68ccb8837ba867550d16f967d9ef21921abe2 (patch) | |
| tree | b54b066642241060223db5a52ff7ba0ca4fcee3b /arch/x86_64/src/kernel | |
| parent | 45e7b24f19b3c4557f98996a44d8857d750ca5b3 (diff) | |
| download | teachos-8eb68ccb8837ba867550d16f967d9ef21921abe2.tar.xz teachos-8eb68ccb8837ba867550d16f967d9ef21921abe2.zip | |
Finish control register and adjust msr
Diffstat (limited to 'arch/x86_64/src/kernel')
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 4 |
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); |
