Index: console/console.c
===================================================================
--- console/console.c	(revision df688cd4349412d3e36163d12a2125dac22d8e45)
+++ console/console.c	(revision 10569b1da9438ff3a5f5539af9c24ca4bb57d2e3)
@@ -41,5 +41,5 @@
 #include <screenbuffer.h>
 
-#define CONSOLE_COUNT 8
+#define CONSOLE_COUNT 12 
 #define MAX_KEYREQUESTS_BUFFERED 32
 
@@ -89,4 +89,58 @@
 	return  CONSOLE_COUNT;
 }
+
+/** Check key and process special keys. 
+ *
+ * */
+static void write_char(int console, char key)
+{
+	screenbuffer_t *scr = &(connections[console].screenbuffer);
+	
+	switch (key) {
+		case '\n':
+			scr->position_y += 1;
+			scr->position_x =  0;
+			break;
+		case '\r':
+			break;
+		case '\t':
+			scr->position_x += 8;
+			scr->position_x -= scr->position_x % 8; 
+			break;
+		case '\b':
+			if (scr->position_x == 0) 
+				break;
+
+			scr->position_x--;
+
+			if (console == active_console) {
+				ipc_call_async_3(fb_info.phone, FB_PUTCHAR, ' ', scr->position_y, scr->position_x, NULL, NULL);
+			}
+	
+			screenbuffer_putchar(scr, ' ');
+			
+			break;
+		default:	
+			if (console == active_console) {
+				ipc_call_async_3(fb_info.phone, FB_PUTCHAR, key, scr->position_y, scr->position_x, NULL, NULL);
+			}
+	
+			screenbuffer_putchar(scr, key);
+			scr->position_x++;
+	}
+	
+	scr->position_y += (scr->position_x >= scr->size_x);
+	
+	if (scr->position_y >= scr->size_y) {
+		scr->position_y = scr->size_y - 1;
+		screenbuffer_clear_line(scr, scr->top_line++);
+		ipc_call_async(fb_info.phone, FB_SCROLL, 1, NULL, NULL);
+	}
+	
+	scr->position_x = scr->position_x % scr->size_x;
+	scr->position_y = scr->position_y  % scr->size_y;
+	
+}
+
 
 /* Handler for keyboard */
@@ -119,5 +173,6 @@
 			if ((c >= '1') && (c < '1' + CONSOLE_COUNT)) {
 				/*FIXME: draw another console content from buffer */
-
+				if (c - KBD_KEY_F1 == active_console)
+						break;
 				active_console = c - '1';
 				conn = &connections[active_console];
@@ -125,4 +180,5 @@
 				ipc_call_async(fb_info.phone, FB_CURSOR_VISIBILITY, 0, NULL, NULL); 
 				ipc_call_async_2(fb_info.phone, FB_CLEAR, 0, 0, NULL, NULL);
+				
 				for (i = 0; i < conn->screenbuffer.size_x; i++)
 					for (j = 0; j < conn->screenbuffer.size_y; j++) {
@@ -167,9 +223,9 @@
 		return;
 	}
-	
+
 	connections[consnum].used = 1;
 	connections[consnum].client_phone = IPC_GET_ARG3(call);
 	screenbuffer_clear(&(connections[consnum].screenbuffer));
-
+	
 	/* Accept the connection */
 	ipc_answer_fast(iid,0,0,0);
@@ -183,12 +239,5 @@
 			return;
 		case CONSOLE_PUTCHAR:
-			
-			/* Send message to fb */
-			if (consnum == active_console) {
-				ipc_call_async_3(fb_info.phone, FB_PUTCHAR, IPC_GET_ARG2(call), connections[consnum].screenbuffer.position_y, \
-						connections[consnum].screenbuffer.position_x, NULL, NULL); 
-			}
-			
-			screenbuffer_putchar(&(connections[consnum].screenbuffer), IPC_GET_ARG2(call));
+			write_char(consnum, IPC_GET_ARG1(call));
 			break;
 		case CONSOLE_CLEAR:
@@ -271,4 +320,5 @@
 	}
 	
+
 	if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, &phonehash) != 0) {
 		return -1;
Index: console/screenbuffer.c
===================================================================
--- console/screenbuffer.c	(revision df688cd4349412d3e36163d12a2125dac22d8e45)
+++ console/screenbuffer.c	(revision 10569b1da9438ff3a5f5539af9c24ca4bb57d2e3)
@@ -44,15 +44,4 @@
 	field->style = scr->style;
 	
-	scr->position_x++;
-	if (scr->position_x == scr->size_x) {
-		scr->position_x = 0;
-		scr->position_y++;
-		if (scr->position_y == scr->size_y) {
-			/* scroll */
-			scr->position_y--;
-			screenbuffer_clear_line(scr, scr->top_line++);
-		}
-	}
-	
 	return 1;
 }
@@ -66,9 +55,9 @@
 	scr->size_x = size_x;
 	scr->size_y = size_y;
-	scr->position_y = 0;
-	scr->position_x = 0;
 	scr->style.fg_color = DEFAULT_FOREGROUND_COLOR; 
 	scr->style.bg_color = DEFAULT_BACKGROUND_COLOR; 
-	scr->top_line = 0;
+	
+	screenbuffer_clear(scr);
+	
 	return scr;
 }
@@ -78,5 +67,5 @@
 	unsigned int i;
 	
-	for (i = 0; i < scr->size_x * scr->size_y; i++) {
+	for (i = 0; i < (scr->size_x * scr->size_y); i++) {
 		scr->buffer[i].character = ' ';
 		scr->buffer[i].style = scr->style;
@@ -114,5 +103,5 @@
 {
 	scr->position_x = x % scr->size_x;
-	scr->position_y = (y + scr->top_line) % scr->size_y;
+	scr->position_y = y  % scr->size_y;
 }
 
Index: libc/generic/io/stream.c
===================================================================
--- libc/generic/io/stream.c	(revision df688cd4349412d3e36163d12a2125dac22d8e45)
+++ libc/generic/io/stream.c	(revision 10569b1da9438ff3a5f5539af9c24ca4bb57d2e3)
@@ -78,5 +78,5 @@
 
 	for (i = 0; i < count; i++)
-		ipc_call_sync_2(console_phone, CONSOLE_PUTCHAR, 0, ((const char *)buf)[i], &r0, &r1);
+		ipc_call_async_2(console_phone, CONSOLE_PUTCHAR, ((const char *)buf)[i], 0, NULL, NULL);
 	
 	return count;
