]>
git.dujemihanovic.xyz Git - nameless-os.git/blob - kernel/kernel.c
4 #include <irq/i8259a.h>
8 extern void double_fault(struct abort_frame
*frame
);
9 extern void keyb_handler(struct interrupt_frame
*frame
);
10 extern void pf_handler(struct fault_frame
*frame
);
11 static struct idt_descriptor idt
[256] __attribute__((aligned(0x10)));
12 static struct idtr idtr
__attribute__((aligned(0x10)));
18 kprint("Welcome to Nameless OS!\nRunning revision: ", 0);
19 kprint(GIT_COMMIT
, 0);
21 kprint("Preparing IDT...\n", 0);
22 idt_set_descriptor(idt
, 8, 0x8, (uint32_t) double_fault
, IDT_INTERRUPT_GATE
, 0x0);
23 idt_set_descriptor(idt
, 14, 0x8, (uint32_t) pf_handler
, IDT_INTERRUPT_GATE
, 0x0);
24 idt_set_descriptor(idt
, 33, 0x8, (uint32_t) keyb_handler
, IDT_INTERRUPT_GATE
, 0x0);
25 kprint("IDT prepared, loading...\n", 0);
26 populate_idtr(&idtr
, idt
);
28 kprint("IDT loaded, enabling interrupts...\n", 0);
33 kprint("All done\n", 0);