26 lines
474 B
C
26 lines
474 B
C
#ifndef IDT_H
|
|
#define IDT_H
|
|
#include <stdint.h>
|
|
|
|
typedef struct InterruptDescriptor_s {
|
|
uint16_t offset_1;
|
|
uint16_t selector;
|
|
uint8_t reserved;
|
|
uint8_t attributes;
|
|
uint16_t offset_2;
|
|
} InterruptDescriptor_t;
|
|
|
|
typedef struct IDTR_s {
|
|
uint16_t size;
|
|
InterruptDescriptor_t* IDT;
|
|
} IDTR_t;
|
|
|
|
extern IDTR_t idtr;
|
|
extern InterruptDescriptor_t* idt_start;
|
|
extern char num_interrupts;
|
|
|
|
void setup_idt();
|
|
void write_descriptors();
|
|
void load_idt();
|
|
|
|
#endif
|