Index: Makefile
===================================================================
--- Makefile	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ Makefile	(revision 6095342f82cb691572e06dbe4aef66ee04a8d94a)
@@ -175,7 +175,5 @@
 	ln -sfn ../../genarch/include/ generic/include/genarch
 
-depend: archlinks Makefile.depend
-
-Makefile.depend:
+depend: archlinks
 	-makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) >Makefile.depend 2>/dev/null
 	#$(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
Index: ch/ia64/include/drivers/keyboard.h
===================================================================
--- arch/ia64/include/drivers/keyboard.h	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ 	(revision )
@@ -1,40 +1,0 @@
-/*
- * Copyright (C) 2005 Jakub Jermar
- * Copyright (C) 2005 Jakub Vana
- * 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 __ia64_KEYBOARD_H__
-#define __ia64_KEYBOARD_H__
-
-#include <arch/types.h>
-#include <arch/ski/ski.h>
-
-extern void keyboard_init(void);
-extern void poll_keyboard(void);
-
-
-#endif
Index: arch/ia64/include/ski/ski.h
===================================================================
--- arch/ia64/include/ski/ski.h	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ arch/ia64/include/ski/ski.h	(revision 6095342f82cb691572e06dbe4aef66ee04a8d94a)
@@ -38,6 +38,5 @@
 
 extern void ski_init_console(void);
-extern void ski_putchar(const char ch);
-extern  __s32 ski_getchar(void);
+extern void poll_keyboard(void);
 	
 #endif
Index: arch/ia64/src/drivers/it.c
===================================================================
--- arch/ia64/src/drivers/it.c	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ arch/ia64/src/drivers/it.c	(revision 6095342f82cb691572e06dbe4aef66ee04a8d94a)
@@ -30,5 +30,5 @@
  
 #include <arch/drivers/it.h>
-#include <arch/drivers/keyboard.h>
+#include <arch/ski/ski.h>
 #include <arch/interrupt.h>
 #include <arch/register.h>
Index: ch/ia64/src/drivers/keyboard.c
===================================================================
--- arch/ia64/src/drivers/keyboard.c	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ 	(revision )
@@ -1,82 +1,0 @@
-/*
- * Copyright (C) 2005 Jakub Vana
- * 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 <console/chardev.h>
-#include <console/console.h>
-#include <putchar.h>
-#include <synch/spinlock.h>
-#include <synch/waitq.h>
-#include <typedefs.h>
-#include <print.h>
-
-static void keyboard_enable(void);
-static void keyboard_disable(void);
-
-static chardev_t kbrd;
-static chardev_operations_t ops = {
-	.resume = keyboard_enable,
-	.suspend = keyboard_disable
-};
-
-bool kb_disable;
-
-/** Initialize keyboard subsystem. */
-void keyboard_init(void)
-{
-	chardev_initialize(&kbrd, &ops);
-	stdin = &kbrd;
-	kb_disable = false;
-}
-
-/** Ask keyboard if a key was pressed. */
-void poll_keyboard(void)
-{
-	char ch;
-
-	if (kb_disable)
-		return;
-
-	ch = ski_getchar();
-	if(ch == '\r')
-		ch = '\n'; 
-	if (ch)
-		chardev_push_character(&kbrd, ch);
-}
-
-/* Called from getc(). */
-void keyboard_enable(void)
-{
-	kb_disable = false;
-}
-
-/* Called from getc(). */
-void keyboard_disable(void)
-{
-	kb_disable = true;	
-}
Index: arch/ia64/src/ia64.c
===================================================================
--- arch/ia64/src/ia64.c	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ arch/ia64/src/ia64.c	(revision 6095342f82cb691572e06dbe4aef66ee04a8d94a)
@@ -33,5 +33,4 @@
 #include <arch/barrier.h>
 #include <arch/types.h>
-#include <arch/drivers/keyboard.h>
 
 #include <console/console.h>
@@ -44,5 +43,4 @@
 	
 	ski_init_console();
-	keyboard_init();
 	it_init();
 }
Index: arch/ia64/src/ski/ski.c
===================================================================
--- arch/ia64/src/ski/ski.c	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ arch/ia64/src/ski/ski.c	(revision 6095342f82cb691572e06dbe4aef66ee04a8d94a)
@@ -28,20 +28,9 @@
 
 #include <arch/ski/ski.h>
+#include <console/console.h>
+#include <console/chardev.h>
 
-/** Initialize debug console
- *
- * Issue SSC (Simulator System Call) to
- * to open debug console.
- */
-void ski_init_console(void)
-{
-	__asm__ (
-		"mov r15=%0\n"
-		"break 0x80000\n"
-		:
-		: "i" (SKI_INIT_CONSOLE)
-		: "r15", "r8"
-	);
-}
+static chardev_t ski_console;
+static bool kb_disable;
 
 /** Display character on debug console
@@ -52,5 +41,5 @@
  * @param ch   Character to be printed.
  */
-void ski_putchar(const char ch)
+void ski_write(chardev_t *d, const char ch)
 {
 	__asm__ (
@@ -91,2 +80,57 @@
 	return (__s32)ch;
 }
+
+/** Ask keyboard if a key was pressed. */
+void poll_keyboard(void)
+{
+	char ch;
+
+	if (kb_disable)
+		return;
+
+	ch = ski_getchar();
+	if(ch == '\r')
+		ch = '\n'; 
+	if (ch)
+		chardev_push_character(&ski_console, ch);
+}
+
+/* Called from getc(). */
+static void ski_kb_enable(chardev_t *)
+{
+	kb_disable = false;
+}
+
+/* Called from getc(). */
+static void ski_kb_disable(chardev_t *d)
+{
+	kb_disable = true;	
+}
+
+
+static chardev_operations_t ski_ops = {
+	.resume = ski_kb_enable,
+	.suspend = ski_kb_disable,
+	.write = ski_write
+};
+
+
+/** Initialize debug console
+ *
+ * Issue SSC (Simulator System Call) to
+ * to open debug console.
+ */
+void ski_init_console(void)
+{
+	__asm__ (
+		"mov r15=%0\n"
+		"break 0x80000\n"
+		:
+		: "i" (SKI_INIT_CONSOLE)
+		: "r15", "r8"
+	);
+
+	chardev_initialize("ski_console", &ski_console, &ski_ops);
+	stdin = &ski_console;
+	stdout = &ski_console;
+}
Index: arch/mips32/src/drivers/arc.c
===================================================================
--- arch/mips32/src/drivers/arc.c	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ arch/mips32/src/drivers/arc.c	(revision 6095342f82cb691572e06dbe4aef66ee04a8d94a)
@@ -189,5 +189,5 @@
 }
 
-static int kbd_polling_enabled;
+static bool kbd_polling_enabled;
 static chardev_t console;
 
@@ -221,10 +221,10 @@
 static void arc_enable(chardev_t *dev)
 {
-	kbd_polling_enabled = 1;	
+	kbd_polling_enabled = true;
 }
 
 static void arc_disable(chardev_t *dev)
 {
-	kbd_polling_enabled = 0;
+	kbd_polling_enabled = false;
 }
 
@@ -247,5 +247,5 @@
 chardev_t * arc_console(void)
 {
-	kbd_polling_enabled = 1;
+	kbd_polling_enabled = true;
 	
 	chardev_initialize("arc_console", &console, &arc_ops);
Index: arch/mips32/src/drivers/serial.c
===================================================================
--- arch/mips32/src/drivers/serial.c	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ arch/mips32/src/drivers/serial.c	(revision 6095342f82cb691572e06dbe4aef66ee04a8d94a)
@@ -34,6 +34,6 @@
 
 static chardev_t console;
-
 static serial_t sconf[SERIAL_MAX];
+static bool kb_enabled;
 
 static void serial_write(chardev_t *d, const char ch)
@@ -52,8 +52,10 @@
 static void serial_enable(chardev_t *d)
 {
+	kb_enabled = true;
 }
 
 static void serial_disable(chardev_t *d)
 {
+	kb_enabled = false;
 }
 
@@ -108,4 +110,5 @@
 	chardev_initialize("serial_console", &console, &serial_ops);
 	console.data = sd;
+	kb_enabled = true;
 
 //	exc_register(2, "serial_drvr", serial_interrupt);
Index: arch/ppc32/src/console.c
===================================================================
--- arch/ppc32/src/console.c	(revision fcfac420803a43318bce80248d718b848e2bcaa3)
+++ arch/ppc32/src/console.c	(revision 6095342f82cb691572e06dbe4aef66ee04a8d94a)
@@ -29,4 +29,6 @@
 #include <putchar.h>
 #include <genarch/ofw/ofw.h>
+#include <console/chardev.h>
+#include <console/console.h>
 
 /** Print one character.
@@ -34,6 +36,18 @@
  * @param ch Character to be printed.
  */
-void putchar(const char ch)
+static void ofw_write(chardev_t *d, const char ch)
 {
 	ofw_putchar(ch);
 }
+
+chardev_t ofw_console;
+static chardev_operations_t ofw_ops = {
+	.write = ofw_write
+};
+
+/** Initialize console to use ofw output */
+void console_init(void)
+{
+	chardev_initialize("ofw_out", &ofw_console, &ofw_ops);
+	stdout = &ofw_console;
+}
