Still need to document a lot of functions, but I cleaned up and explained a lot of the code via comments.
32 lines
614 B
C
32 lines
614 B
C
/* IDT.h
|
|
* Interrupt Descriptor Table
|
|
*
|
|
* IDT related structures, globals and functions
|
|
*/
|
|
#ifndef IDT_H
|
|
#define IDT_H
|
|
|
|
#include <stdint.h>
|
|
|
|
typedef struct InterruptDescriptor_s {
|
|
uint16_t offset_lo;
|
|
uint16_t selector;
|
|
uint8_t reserved;
|
|
uint8_t attributes;
|
|
uint16_t offset_hi;
|
|
} InterruptDescriptor_t;
|
|
|
|
typedef struct IDTR_s {
|
|
uint16_t size;
|
|
InterruptDescriptor_t* IDT;
|
|
} __attribute__((packed)) IDTR_t;
|
|
|
|
extern IDTR_t idtr;
|
|
extern InterruptDescriptor_t idt_start;
|
|
extern unsigned char num_interrupts;
|
|
|
|
void setup_idt();
|
|
void write_descriptors();
|
|
extern void load_idt();
|
|
|
|
#endif
|