]> git.dujemihanovic.xyz Git - nameless-os.git/blobdiff - kernel/kernel/kernel.c
Merge branch 'ps2-driver' into mm
[nameless-os.git] / kernel / kernel / kernel.c
index 64e64ae45b01f0c805018aa51bac6bb868439a39..b198fcf49e4fc6b034c5d7e987bd8e1729680b6a 100644 (file)
@@ -3,6 +3,7 @@
 #include <irq/idt.h>
 #include <irq/interrupt.h>
 #include <irq/i8259a.h>
+#include <input/ps2.h>
 #include <stdint.h>
 #include <mm/paging.h>
 #include <panic.h>
@@ -92,6 +93,18 @@ void kmain(struct e820_map *mmap, int mmap_size)
        pic_init(0x20, 0x28);
        pic_mask_all();
        asm volatile ("sti");
+       kprint("Initializing PS/2...\n", VGA_LIGHT_GRAY, VGA_BLACK);
+       int ret = ps2_initialize();
+       switch (ret) {
+       case -1:
+               kprint("No PS/2 devices found or something is faulty\n", VGA_LIGHT_GRAY, VGA_BLACK);
+               break;
+       case 0:
+               kprint("One PS/2 device found\n", VGA_LIGHT_GRAY, VGA_BLACK);
+               break;
+       case 1:
+               kprint("Two PS/2 devices found\n", VGA_LIGHT_GRAY, VGA_BLACK);
+       }
        kprint("All done\n", VGA_LIGHT_GRAY, VGA_BLACK);
        while(1);
 }