29 lines
412 B
C
29 lines
412 B
C
#include <stdint.h>
|
|
|
|
extern void halt();
|
|
extern void idt_load();
|
|
extern void reboot();
|
|
|
|
typedef struct {
|
|
uint16_t offset_low;
|
|
uint16_t selector;
|
|
uint8_t zero;
|
|
uint8_t flags;
|
|
uint16_t offset_high;
|
|
} idt_entry_t __attribute__((packed));
|
|
|
|
typedef struct {
|
|
uint16_t limit;
|
|
uint32_t base;
|
|
} idt_ptr_t;
|
|
|
|
idt_entry_t idt[256];
|
|
idt_ptr_t idtr;
|
|
|
|
void load_idt() {}
|
|
|
|
void kmain() {
|
|
load_idt();
|
|
halt();
|
|
}
|