This commit is contained in:
2025-04-30 23:03:44 -07:00
parent a464e109cb
commit ecfa54e225
30 changed files with 584 additions and 1191 deletions

24
kernel/idt.h Normal file
View File

@@ -0,0 +1,24 @@
#ifndef IDT_H
#define IDT_H
#include <stdint.h>
#define IDT_ENTRIES 256
typedef struct {
uint16_t offset_low;
uint16_t selector;
uint8_t zero;
uint8_t type_attr;
uint16_t offset_high;
} __attribute__((packed)) idt_entry_t;
typedef struct {
uint16_t limit;
uint32_t base;
} __attribute__((packed)) idt_ptr_t;
void idt_set_gate(int n, uint32_t handler);
void idt_init(void);
#endif