2021-03-01 17:17:24 -05:00
|
|
|
#ifndef IDT_H
|
|
|
|
#define IDT_H
|
|
|
|
|
|
|
|
#include "types.h"
|
2021-03-09 01:28:16 -05:00
|
|
|
#include "isr.h"
|
2021-03-01 17:17:24 -05:00
|
|
|
|
|
|
|
struct IDT {
|
|
|
|
uint32_t base;
|
|
|
|
uint16_t selector;
|
|
|
|
uint8_t flags;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
struct IDT_ptr {
|
|
|
|
uint16_t limit;
|
|
|
|
uint32_t base;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
uint8_t idt_entries[8 * 256]; // 8 bytes per entry * 256 entries
|
|
|
|
|
|
|
|
struct IDT createIDT(uint32_t base, uint16_t selector, uint8_t flags);
|
|
|
|
void encodeIDT(uint8_t* idtEntry, struct IDT source);
|
|
|
|
void initializeIDT();
|
|
|
|
|
|
|
|
#endif // IDT_H
|