First try in keyboard drivermaster
authorDavid Kolossa <[email protected]>
Sat, 15 Nov 2008 12:25:22 +0000 (15 13:25 +0100)
committerMathias Gottschlag <[email protected]>
Sat, 22 Nov 2008 18:08:25 +0000 (22 19:08 +0100)
build/menu.lst
programs/CMakeLists.txt
programs/ps2/CMakeLists.txt [new file with mode: 0644]
programs/ps2/keyboard.c [new file with mode: 0644]
programs/ps2/keyboard.h [new file with mode: 0644]

index 0c9a3e6..6cb46f3 100644 (file)
@@ -8,6 +8,7 @@ module  /bin/floppy
 module  /bin/ramdisk
 module  /bin/tests
 module  /bin/test1
+module  /bin/ps2
 
 title   incOS x86 SMP
 root    (fd0)
index 69d7a58..59e85ac 100644 (file)
@@ -15,5 +15,6 @@ add_subdirectory(floppy)
 add_subdirectory(ramdisk)
 add_subdirectory(tests)
 add_subdirectory(test1)
+add_subdirectory(ps2)
 
 set(PROGRAMS ${PROGRAMS} PARENT_SCOPE)
diff --git a/programs/ps2/CMakeLists.txt b/programs/ps2/CMakeLists.txt
new file mode 100644 (file)
index 0000000..03bdeb4
--- /dev/null
@@ -0,0 +1,9 @@
+set(SRC
+keyboard.c
+../libc/crt0.c
+)
+add_executable(ps2 ${SRC})
+target_link_libraries(ps2 c incos)
+add_program(ps2)
diff --git a/programs/ps2/keyboard.c b/programs/ps2/keyboard.c
new file mode 100644 (file)
index 0000000..083d2fb
--- /dev/null
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <stdint.h>
+#include <cdi/io.h>
+#include <kernel.h>
+#include "keyboard.h"
+
+static void kbIRQHandler()
+{
+       uint8_t data;
+       data = cdi_inb(0x60);
+       
+       // DEBUG:
+       printf("%02X\n", data);
+
+       keExitIRQ();    
+}
+
+void kbRegisterIRQ()
+{
+       // Register IRQ
+       keRegisterIRQHandler(0x01, kbIRQHandler);
+}
+
+int main(void)
+{
+       kbRegisterIRQ();
+       while(1);
+       return 0;
+}
+
diff --git a/programs/ps2/keyboard.h b/programs/ps2/keyboard.h
new file mode 100644 (file)
index 0000000..47b5dba
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef KEYBOARD_H_INCLUDED
+#define KEYBOARD_H_INCLUDED
+
+static void kbIRQHandler();
+void kbRegisterIRQ();
+
+#endif