aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/context_switching
diff options
context:
space:
mode:
authorFabian Imhof <fabian.imhof@ost.ch>2025-03-13 15:46:16 +0000
committerFabian Imhof <fabian.imhof@ost.ch>2025-03-13 15:46:16 +0000
commit11db9338dac611ea32e202add5ce5055b54ebb58 (patch)
treefa68d328a1fe5e07e52e32aac866a0bcc57094ab /arch/x86_64/src/context_switching
parentbdbe6d4bc0f2966541bcd5a47c1a4ad9cbff16fa (diff)
downloadteachos-11db9338dac611ea32e202add5ce5055b54ebb58.tar.xz
teachos-11db9338dac611ea32e202add5ce5055b54ebb58.zip
fixup typing and continue adding gdt
Diffstat (limited to 'arch/x86_64/src/context_switching')
-rw-r--r--arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp b/arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp
index 1cba13c..ca3d7ff 100644
--- a/arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp
+++ b/arch/x86_64/src/context_switching/descriptor_table/global_descriptor_table.cpp
@@ -1,9 +1,9 @@
-#include "global_descriptor_table.hpp"
+#include "arch/context_switching/descriptor_table/global_descriptor_table.hpp"
+#include "arch/context_switching/descriptor_table/segment_descriptor.hpp"
+#include "arch/kernel/cpu/lgdt.hpp"
#include "arch/stl/vector.hpp"
-#include "segment_descriptor.hpp"
-
namespace teachos::arch::context_switching::descriptor_table
{
auto create_global_descriptor_table() -> global_descriptor_table
@@ -43,15 +43,14 @@ namespace teachos::arch::context_switching::descriptor_table
return global_descriptor_table;
}
- auto load_global_descriptor_table(global_descriptor_table_pointer gdt_pointer) -> void
- {
- //
- }
-
auto initialize_global_descriptor_table() -> global_descriptor_table
{
global_descriptor_table gdt{create_global_descriptor_table()};
+
+ // TODO: Second argument does not work yet (because pointer hpp)
global_descriptor_table_pointer gdt_pointer{gdt.size() - 1, &gdt};
- load_global_descriptor_table(gdt_pointer);
+ kernel::cpu::load_global_descriptor_table(gdt_pointer);
+
+ return gdt;
}
} // namespace teachos::arch::context_switching::descriptor_table \ No newline at end of file