Index: arch/ia32/src/drivers/i8042.c
===================================================================
--- arch/ia32/src/drivers/i8042.c	(revision 1bdaa3fe91f893198b8c374a086258aecc575fc9)
+++ arch/ia32/src/drivers/i8042.c	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
@@ -52,7 +52,7 @@
 #define LOCKED_CAPSLOCK		(1<<0)
 
-static spinlock_t keylock;	/**< keylock protects keyflags and lockflags. */
+static spinlock_t keylock;		/**< keylock protects keyflags and lockflags. */
 static volatile int keyflags;		/**< Tracking of multiple keypresses. */
-static volatile int lockflags;		/**< Tracking of multiple lock keys keypresses. */
+static volatile int lockflags;		/**< Tracking of multiple keys lockings. */
 
 /** Primary meaning of scancodes. */
Index: arch/mips32/Makefile.inc
===================================================================
--- arch/mips32/Makefile.inc	(revision 1bdaa3fe91f893198b8c374a086258aecc575fc9)
+++ arch/mips32/Makefile.inc	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
@@ -127,3 +127,4 @@
 	arch/$(ARCH)/src/fpu_context.c \
 	arch/$(ARCH)/src/fmath.c \
-	arch/$(ARCH)/src/drivers/arc.c
+	arch/$(ARCH)/src/drivers/arc.c \
+	arch/$(ARCH)/src/drivers/keyboard.c
Index: arch/mips32/include/drivers/keyboard.h
===================================================================
--- arch/mips32/include/drivers/keyboard.h	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
+++ arch/mips32/include/drivers/keyboard.h	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __mips32_KEYBOARD_H__
+#define __mips32_KEYBOARD_H__
+
+#include <arch/types.h>
+#include <arch/interrupt.h>
+
+/** Address of 'keyboard' device. */
+#define KEYBOARD_ADDRESS		0xB0000004
+
+extern void keyboard_init(void);
+extern void keyboard(void);
+
+
+#endif
Index: arch/mips32/include/interrupt.h
===================================================================
--- arch/mips32/include/interrupt.h	(revision 1bdaa3fe91f893198b8c374a086258aecc575fc9)
+++ arch/mips32/include/interrupt.h	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
@@ -32,5 +32,9 @@
 #include <arch/exception.h>
 
-#define TIMER_INTERRUPT   7
+#define IRQ3	3
+#define IRQ7	7
+
+#define KEYBOARD_IRQ	IRQ3
+#define TIMER_IRQ   	IRQ7
 
 extern void interrupt(struct exception_regdump *pstate);
Index: arch/mips32/src/drivers/keyboard.c
===================================================================
--- arch/mips32/src/drivers/keyboard.c	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
+++ arch/mips32/src/drivers/keyboard.c	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <arch/drivers/keyboard.h>
+#include <arch/cp0.h>
+#include <putchar.h>
+
+void keyboard_init(void)
+{
+	/* unmask keyboard interrupt */
+	cp0_unmask_int(KEYBOARD_IRQ);
+}
+
+void keyboard(void)
+{
+	putchar(*((char *) KEYBOARD_ADDRESS));
+}
Index: arch/mips32/src/interrupt.c
===================================================================
--- arch/mips32/src/interrupt.c	(revision 1bdaa3fe91f893198b8c374a086258aecc575fc9)
+++ arch/mips32/src/interrupt.c	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
@@ -36,4 +36,5 @@
 #include <symtab.h>
 #include <arch/drivers/arc.h>
+#include <arch/drivers/keyboard.h>
 
 static void print_regdump(struct exception_regdump *pstate)
@@ -111,5 +112,7 @@
 					break;
 				case 2: /* IRQ0 */
-				case 3: /* IRQ1 */
+				case KEYBOARD_IRQ:
+					keyboard();
+					break;
 				case 4: /* IRQ2 */
 				case 5: /* IRQ3 */
@@ -119,5 +122,5 @@
 					panic("unhandled interrupt %d\n", i);
 					break;
-				case TIMER_INTERRUPT:
+				case TIMER_IRQ:
 					/* clear timer interrupt & set new */
 					cp0_compare_write(cp0_count_read() + cp0_compare_value); 
Index: arch/mips32/src/mips32.c
===================================================================
--- arch/mips32/src/mips32.c	(revision 1bdaa3fe91f893198b8c374a086258aecc575fc9)
+++ arch/mips32/src/mips32.c	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
@@ -75,5 +75,5 @@
 	 * Unmask hardware clock interrupt.
 	 */
-	cp0_unmask_int(TIMER_INTERRUPT);
+	cp0_unmask_int(TIMER_IRQ);
 
 	/*
Index: contrib/conf/msim.conf
===================================================================
--- contrib/conf/msim.conf	(revision 1bdaa3fe91f893198b8c374a086258aecc575fc9)
+++ contrib/conf/msim.conf	(revision a7fdfe105a1a679fcd33e43de73fce4e1fde4aa4)
@@ -11,2 +11,3 @@
 
 add dprinter printer 0x10000000
+add dkeyboard keyboard 0x10000004 3
