X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B?a=blobdiff_plain;f=kernel%2Fkernel.c;h=3f6c256d8029f2a06429da169381e0b401dea300;hb=cbb0204cd5f26375290d72bd4027e42832786f22;hp=4c6efd8692da90d7ab15cf782846b3194e9483f7;hpb=628db992cdf71f22597a2dcc86bcf456ff7c8db8;p=nameless-os.git diff --git a/kernel/kernel.c b/kernel/kernel.c index 4c6efd8..3f6c256 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -1,8 +1,9 @@ +#include #include #include #include #include -#include +#include extern void double_fault(struct abort_frame *frame); extern void keyb_handler(struct interrupt_frame *frame); @@ -11,10 +12,22 @@ struct idtr idtr __attribute__((aligned(0x10))); void kmain(void) { + int ps2_success; screen_clear(); kprint("Welcome to Nameless OS!\nRunning revision: ", 0); kprint(GIT_COMMIT, 0); kprint("\n", 0); + ps2_success = ps2_initialize(); + switch (ps2_success) { + case -1: + kprint("No PS/2 devices found or working, we will have no input\n", 0); + break; + case 0: + kprint("Found one working PS/2 device\n", 0); + break; + case 1: + kprint("Found two working PS/2 devices\n", 0); + } kprint("Preparing IDT...\n", 0); idt_set_descriptor(idt, 0x8, 0x8, (uint32_t) double_fault, IDT_TRAP_GATE, 0x0); idt_set_descriptor(idt, 0x21, 0x8, (uint32_t) keyb_handler, IDT_INTERRUPT_GATE, 0x0);