2025-06-16 04:52:05 +00:00
|
|
|
#ifndef IDT_H
|
|
|
|
|
#define IDT_H
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
typedef struct InterruptDescriptor_s {
|
2025-06-28 04:14:42 +00:00
|
|
|
uint16_t offset_lo;
|
2025-06-16 04:52:05 +00:00
|
|
|
uint16_t selector;
|
|
|
|
|
uint8_t reserved;
|
|
|
|
|
uint8_t attributes;
|
2025-06-28 04:14:42 +00:00
|
|
|
uint16_t offset_hi;
|
2025-06-16 04:52:05 +00:00
|
|
|
} InterruptDescriptor_t;
|
|
|
|
|
|
|
|
|
|
typedef struct IDTR_s {
|
|
|
|
|
uint16_t size;
|
|
|
|
|
InterruptDescriptor_t* IDT;
|
2025-06-28 04:14:42 +00:00
|
|
|
} __attribute__((packed)) IDTR_t;
|
2025-06-16 04:52:05 +00:00
|
|
|
|
|
|
|
|
extern IDTR_t idtr;
|
2025-06-28 04:14:42 +00:00
|
|
|
extern InterruptDescriptor_t idt_start;
|
|
|
|
|
extern unsigned char num_interrupts;
|
2025-06-16 04:52:05 +00:00
|
|
|
|
|
|
|
|
void setup_idt();
|
|
|
|
|
void write_descriptors();
|
2025-06-28 04:14:42 +00:00
|
|
|
extern void load_idt();
|
2025-06-16 04:52:05 +00:00
|
|
|
|
|
|
|
|
#endif
|