feat: add IDT

This commit is contained in:
2026-10-03 09:05:40 +02:00
parent 58afc2fc61
commit 86027f21db
10 changed files with 204 additions and 46 deletions
+11 -5
View File
@@ -1,15 +1,21 @@
#include "./arch.hpp"
arch* arch::get() {
static x86_64::arch s_arch;
return &s_arch;
arch& arch::get() {
return x86_64::arch::get();
}
namespace x86_64 {
arch& arch::get() {
static x86_64::arch s_arch;
return s_arch;
}
void arch::init() {
load_gdt(m_gdt, sizeof(m_gdt));
reload_segments(0x8, 0x10);
m_gdt.load();
reload_segments(gdt::KERNEL_CS, gdt::KERNEL_DS);
m_idt.load();
}
} // namespace x86_64