aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/context_switching/main.cpp
diff options
context:
space:
mode:
authorFabian Imhof <fabian.imhof@ost.ch>2025-04-27 14:43:35 +0000
committerFabian Imhof <fabian.imhof@ost.ch>2025-04-27 14:43:35 +0000
commit1838b8c108a842d2b4f4be55efd17be8b91f87c2 (patch)
treef6073e7d6b868a5f18de5ad2e6e502756c229c96 /arch/x86_64/src/context_switching/main.cpp
parent95c299db969b29eb4a4742ff7715adecfe138bd5 (diff)
parent7c5a40a0de0c5e3ce0a51aa5414c4a433190c60c (diff)
downloadteachos-1838b8c108a842d2b4f4be55efd17be8b91f87c2.tar.xz
teachos-1838b8c108a842d2b4f4be55efd17be8b91f87c2.zip
Merge branch 'feat_inital_context_switching' of ssh://gitlab.ost.ch:45022/teachos/kernel into feat_inital_context_switching
Diffstat (limited to 'arch/x86_64/src/context_switching/main.cpp')
-rw-r--r--arch/x86_64/src/context_switching/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86_64/src/context_switching/main.cpp b/arch/x86_64/src/context_switching/main.cpp
index 4e13b1c..33af765 100644
--- a/arch/x86_64/src/context_switching/main.cpp
+++ b/arch/x86_64/src/context_switching/main.cpp
@@ -20,6 +20,8 @@ namespace teachos::arch::context_switching
constexpr interrupt_descriptor_table::segment_selector KERNEL_CODE_SEGMENT_SELECTOR{
1U, interrupt_descriptor_table::segment_selector::REQUEST_LEVEL_KERNEL};
+ constexpr interrupt_descriptor_table::segment_selector KERNEL_DATA_SEGMENT_SELECTOR{
+ 2U, interrupt_descriptor_table::segment_selector::REQUEST_LEVEL_KERNEL};
constexpr kernel::cpu::far_pointer KERNEL_CODE_POINTER{&kernel::cpu::reload_data_segment_registers,
KERNEL_CODE_SEGMENT_SELECTOR};
constexpr context_switching::interrupt_descriptor_table::segment_selector USER_CODE_SEGMENT_SELECTOR{
@@ -45,6 +47,8 @@ namespace teachos::arch::context_switching
auto syscall_handler() -> void
{
+ kernel::cpu::validate_segment_registers(KERNEL_CODE_SEGMENT_SELECTOR, KERNEL_DATA_SEGMENT_SELECTOR);
+
uint64_t dummy{};
switch (dummy)
{