From 7ee9347560768641096df68c545ac085a20233e4 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Sun, 17 Aug 2025 14:16:55 -0400 Subject: working usermode pager. fix usermode interrupts --- include/arch/x86_64/processor.h | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'include/arch/x86_64/processor.h') diff --git a/include/arch/x86_64/processor.h b/include/arch/x86_64/processor.h index f8a93ce..1afa6cc 100644 --- a/include/arch/x86_64/processor.h +++ b/include/arch/x86_64/processor.h @@ -18,13 +18,22 @@ typedef struct jove_TSS { uint32_t resv0; - uint64_t rsp[3]; - uint32_t resv1; - uint64_t ist[8]; - uint32_t resv2[2]; - uint16_t resv3; + uint64_t rsp0; + uint64_t rsp1; + uint64_t rsp2; + uint64_t resv1; + uint64_t resv2; + uint64_t ist1; + uint64_t ist2; + uint64_t ist3; + uint64_t ist4; + uint64_t ist5; + uint64_t ist6; + uint64_t ist7; + uint64_t resv3; + uint16_t resv4; uint16_t iopb; -} tss_t; +} __attribute__((packed)) tss_t; enum { @@ -39,6 +48,12 @@ enum GDT_ENTRY_COUNT }; +#define GDT_OFFSET_KERNEL_CODE (GDT_ENTRY_KERNEL_CODE * sizeof(segment_descriptor_t)) +#define GDT_OFFSET_KERNEL_DATA (GDT_ENTRY_KERNEL_DATA * sizeof(segment_descriptor_t)) +#define GDT_OFFSET_USER_DATA (GDT_ENTRY_USER_DATA * sizeof(segment_descriptor_t)) +#define GDT_OFFSET_USER_CODE (GDT_ENTRY_USER_CODE * sizeof(segment_descriptor_t)) +#define GDT_OFFSET_TSS (GDT_ENTRY_TSS_LOW * sizeof(segment_descriptor_t)) + typedef struct jove_Processor { physptr_t pdir; -- cgit v1.2.1