From c5e38801f3b63538b29f2e50e39670eb09ddae1a Mon Sep 17 00:00:00 2001 From: ngiddings Date: Thu, 15 Apr 2021 05:49:11 -0500 Subject: [PATCH] Fixed the idt_info_t struct and lidt() Info was not loaded properly, causing crash --- src/x86/interrupts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x86/interrupts.c b/src/x86/interrupts.c index d8fb7df..aadce4a 100644 --- a/src/x86/interrupts.c +++ b/src/x86/interrupts.c @@ -4,13 +4,13 @@ struct idt_info_t { uint16_t size; void *location; -}; +} __attribute__ ((packed)); void lidt(struct interrupt_descriptor_t *idt) { struct idt_info_t idt_info; - idt_info.size = sizeof(idt) - 1; - idt_info.location = (void *)&idt; + idt_info.size = sizeof(struct interrupt_descriptor_t) * 256 - 1; + idt_info.location = (void *)idt; asm("lidt (%0)" : : "r"(&idt_info));