]>
git.dujemihanovic.xyz Git - nameless-os.git/blob - kernel/kernel.c
5 #include <irq/i8259a.h>
8 extern void double_fault(struct abort_frame
*frame
);
9 extern void keyb_handler(struct interrupt_frame
*frame
);
10 struct idt_descriptor idt
[256] __attribute__((aligned(0x10)));
11 struct idtr idtr
__attribute__((aligned(0x10)));
17 kprint("Welcome to Nameless OS!\nRunning revision: ", 0);
18 kprint(GIT_COMMIT
, 0);
20 ps2_success
= ps2_initialize();
21 switch (ps2_success
) {
23 kprint("No PS/2 devices found or working, we will have no input\n", 0);
26 kprint("Found one working PS/2 device\n", 0);
29 kprint("Found two working PS/2 devices\n", 0);
31 kprint("Preparing IDT...\n", 0);
32 idt_set_descriptor(idt
, 0x8, 0x8, (uint32_t) double_fault
, IDT_TRAP_GATE
, 0x0);
33 idt_set_descriptor(idt
, 0x21, 0x8, (uint32_t) keyb_handler
, IDT_INTERRUPT_GATE
, 0x0);
34 kprint("IDT prepared, loading...\n", 0);
35 populate_idtr(&idtr
, idt
);
37 kprint("IDT loaded, enabling interrupts...\n", 0);
42 kprint("All done\n", 0);