]>
git.dujemihanovic.xyz Git - nameless-os.git/blob - kernel/kernel.c
4 #include <irq/i8259a.h>
5 #include <time/i8254.h>
8 extern void double_fault(struct abort_frame
*frame
);
9 extern void keyb_handler(struct interrupt_frame
*frame
);
10 extern void timer_tick(struct interrupt_frame
*frame
);
11 struct idt_descriptor idt
[256] __attribute__((aligned(0x10)));
12 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
, 0x8, 0x8, (uint32_t) double_fault
, IDT_TRAP_GATE
, 0x0);
23 idt_set_descriptor(idt
, 0x20, 0x8, (uint32_t) timer_tick
, IDT_INTERRUPT_GATE
, 0x0);
24 idt_set_descriptor(idt
, 0x21, 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("Setting up timer...\n", 0);
34 i8254_configure_channel(0, SQUARE_WAVE_GENERATOR
, 0);
36 kprint("All done\n", 0);