Index: kernel/arch/sparc64/src/drivers/sgcn.c
===================================================================
--- kernel/arch/sparc64/src/drivers/sgcn.c	(revision 1462d35d75ed11831cc803ee058338daa2ddebf2)
+++ kernel/arch/sparc64/src/drivers/sgcn.c	(revision 08fed0ad9e4bea3fef001e2f6f14c85e82781cb2)
@@ -131,21 +131,18 @@
 
 /* functions referenced from definitions of I/O operations structures */
-static void sgcn_noop(chardev_t *);
-static void sgcn_putchar(chardev_t *, const char, bool);
-static char sgcn_key_read(chardev_t *);
-
-/** character device operations */
-static chardev_operations_t sgcn_ops = {
-	.suspend = sgcn_noop,
-	.resume = sgcn_noop,
-	.read = sgcn_key_read,
+static void sgcn_putchar(outdev_t *, const char, bool);
+
+/** SGCN output device operations */
+static outdev_operations_t sgcnout_ops = {
 	.write = sgcn_putchar
 };
 
-/** SGCN character device */
-chardev_t sgcn_io;
-
-/** Address of the chardev, which is connected to SGCN. */
-static chardev_t *sgcnout;
+/** SGCN input device operations */
+static indev_operations_t sgcnin_ops = {
+	.poll = NULL
+};
+
+static indev_t sgcnin;		/**< SGCN input device. */
+static outdev_t sgcnout;	/**< SGCN output device. */
 
 /**
@@ -204,4 +201,9 @@
 static void sgcn_buffer_begin_init(void)
 {
+	static bool initialized;
+	
+	if (initialized)
+		return;
+
 	init_sram_begin();
 		
@@ -220,11 +222,6 @@
 	sysinfo_set_item_val("sram.buffer.offset", NULL,
 	    SRAM_TOC->keys[i].offset);
-}
-
-/**
- * Default suspend/resume operation for the input device.
- */
-static void sgcn_noop(chardev_t *d)
-{
+	
+	initialized = true;
 }
 
@@ -272,5 +269,5 @@
  * written straight away. 
  */
-static void sgcn_putchar(struct chardev * cd, const char c, bool silent)
+static void sgcn_putchar(outdev_t *od, const char c, bool silent)
 {
 	if (!silent) {
@@ -286,12 +283,4 @@
 
 /**
- * Called when actively reading the character. Not implemented yet.
- */
-static char sgcn_key_read(chardev_t *d)
-{
-	return (char) 0;
-}
-
-/**
  * Grabs the input for kernel.
  */
@@ -338,6 +327,5 @@
 		*in_rdptr_ptr = (((*in_rdptr_ptr) - begin + 1) % size) + begin;
 			
-		if (sgcnout)
-			chardev_push_character(sgcnout, c);	
+		indev_push_character(&sgcnin, c);	
 	}	
 
@@ -358,8 +346,7 @@
 
 /**
- * A public function which initializes I/O from/to Serengeti console
- * and sets it as a default input/output. 
- */
-void sgcn_init(chardev_t *devout)
+ * A public function which initializes input from the Serengeti console.
+ */
+indev_t *sgcnin_init(void)
 {
 	sgcn_buffer_begin_init();
@@ -369,5 +356,4 @@
 	sysinfo_set_item_val("kbd", NULL, true);
 	sysinfo_set_item_val("kbd.type", NULL, KBD_SGCN);
-	sysinfo_set_item_val("fb.kind", NULL, 4);
 
 	thread_t *t = thread_create(kkbdpoll, NULL, TASK, 0, "kkbdpoll", true);
@@ -376,8 +362,20 @@
 	thread_ready(t);
 	
-	chardev_initialize("sgcn_io", &sgcn_io, &sgcn_ops);
-	stdout = &sgcn_io;
-
-	sgcnout = devout;
+	indev_initialize("sgcnin", &sgcnin, &sgcnin_ops);
+
+	return &sgcnin;
+}
+
+/**
+ * A public function which initializes output to the Serengeti console.
+ */
+void sgcnout_init(void)
+{
+	sgcn_buffer_begin_init();
+
+	sysinfo_set_item_val("fb.kind", NULL, 4);
+
+	outdev_initialize("sgcnout", &sgcnout, &sgcnout_ops);	
+	stdout = &sgcnout;
 }
 
