diff --git a/headers/idt.h b/headers/idt.h index 396558b..3159b1b 100644 --- a/headers/idt.h +++ b/headers/idt.h @@ -1,9 +1,9 @@ #pragma once // doc : https://wiki.osdev.org/Interrupt_Descriptor_Table#IDTR -struct { +struct idt_descriptor { uint16_t size; uint32_t offset; -} __attribute__((packed)) idt_descriptor; +} __attribute__((packed)); #define IDT_SIZE 256 \ No newline at end of file diff --git a/src/interrupt/idt.c b/src/interrupt/idt.c index 7145a81..7754a95 100644 --- a/src/interrupt/idt.c +++ b/src/interrupt/idt.c @@ -4,7 +4,7 @@ #include "idt.h" uint16_t idt_entries[IDT_SIZE * 4]; -struct idt_descriptor *idtr = (struct gdt_descriptor *)GDT_ADDRESS; +struct idt_descriptor idtr; static void set_idt_entry_value(uint16_t *target, uint32_t offset, uint16_t selector, uint8_t dpl, @@ -31,6 +31,6 @@ static void set_idt_entry_value(uint16_t *target, uint32_t offset, void init_idt(void) { - idtr->size = 8 * IDT_SIZE - 1; - idtr->offset = (uint32_t)&idt_entries; + idtr.size = 8 * IDT_SIZE - 1; + idtr.offset = (uint32_t)&idt_entries; } \ No newline at end of file