diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2025-08-17 14:16:55 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2025-08-17 14:16:55 -0400 |
commit | 7ee9347560768641096df68c545ac085a20233e4 (patch) | |
tree | 5b567f2e98cd9e6aeee33eeecd7fbf6f2fafdeab /arch/x86_64/idt.c | |
parent | f466364b8a3858e7b3f19258d142851cb4a7e6d6 (diff) | |
download | jove-kernel-7ee9347560768641096df68c545ac085a20233e4.tar.gz jove-kernel-7ee9347560768641096df68c545ac085a20233e4.tar.bz2 jove-kernel-7ee9347560768641096df68c545ac085a20233e4.zip |
working usermode pager. fix usermode interrupts
Diffstat (limited to 'arch/x86_64/idt.c')
-rw-r--r-- | arch/x86_64/idt.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/x86_64/idt.c b/arch/x86_64/idt.c index 99e1da1..1080f92 100644 --- a/arch/x86_64/idt.c +++ b/arch/x86_64/idt.c @@ -1,16 +1,13 @@ #include "arch/x86_64/tables.h" #include "arch/x86_64/idt.h" -__attribute__((aligned(4096))) +__attribute__((aligned(0x10))) interrupt_gate_t s_idtd[256]; -int64_t __isr_err; -int64_t __isr_num; - void isr_handle(ivt_state_t* state) { - kpanic_state(state, "Unhandled interrupt %i", __isr_num); + kpanic_state(state, "Unhandled interrupt %i", state->num); } void @@ -21,13 +18,9 @@ ivt_setup(void) uintptr_t base = __ivt[i]; s_idtd[i] = (interrupt_gate_t) { .base_0_15 = (base & 0xFFFF), - .segment_selector = 0x8, + .cs = GDT_OFFSET_KERNEL_CODE, .ist = 0, - .zero_0 = 0, - .type = 0xE, - .zero_1 = 0, - .dpl = 0, - .p = 1, + .type_flags = IDT_TYPE_INT_GATE | IDT_FLAG_DPL(0) | IDT_FLAG_P, .base_16_31 = (base >> 16) & 0xFFFF, .base_32_63 = (base >> 32) & 0xFFFFFFFF, .resv = 0 |