idt.h (432B)
1 #ifndef IDT_H 2 #define IDT_H 3 4 #include <stdint.h> 5 6 #define IDT_ENTRIES 256 7 8 struct idt_entry { 9 uint16_t base_lower; 10 uint16_t selector; 11 uint8_t unused; 12 uint8_t type_attributes; 13 uint16_t base_higher; 14 } __attribute__((packed)); 15 16 struct idt_description { 17 uint16_t limit; 18 uint32_t base; 19 } __attribute__((packed)); 20 21 struct idt_description idt_desc; 22 struct idt_entry idt[IDT_ENTRIES]; 23 24 void idt_setup(); 25 26 #endif