Index: console/console.c
===================================================================
--- console/console.c	(revision b917098058db285fd16c70c20e83ec163472c86f)
+++ console/console.c	(revision a805c24a0df4334c484ba532cf2c829648f551a3)
@@ -172,22 +172,26 @@
 			
 			retval = 0;
-			c = IPC_GET_ARG1(call) - '0';
+			c = IPC_GET_ARG1(call);
 			/* switch to another virtual console */
 			
 			conn = &connections[active_console];
 //			if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) {
-			if ((c >= 0) && (c < CONSOLE_COUNT)) {
-				/*FIXME: draw another console content from buffer */
-				if (c == active_console)
-						break;
+			if ((c >= '0') && (c < '0' + CONSOLE_COUNT)) {
 				
-				if (c == 0) {
+				if (c == '0') {
 					/* switch to kernel console*/
+					sync_send_2(fb_info.phone, FB_CURSOR_VISIBILITY, 0, 0, NULL, NULL);
+					nsend_call_2(fb_info.phone, FB_SET_STYLE, DEFAULT_FOREGROUND_COLOR, DEFAULT_BACKGROUND_COLOR); 
+					nsend_call(fb_info.phone, FB_CLEAR, 0); 
+					/* FIXME: restore kernel console */
 					 __SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE);
+					 break;
 					 
 				} else {
+					c = c - '1';
+					if (c == active_console)
+						break;
 					active_console = c;
 				}
-				
 				
 				conn = &connections[active_console];
@@ -331,5 +335,5 @@
 	ipc_call_sync_2(fb_info.phone, FB_GET_CSIZE, 0, 0, &(fb_info.rows), &(fb_info.cols)); 
 	nsend_call_2(fb_info.phone, FB_SET_STYLE, DEFAULT_FOREGROUND_COLOR, DEFAULT_BACKGROUND_COLOR); 
-	nsend_call(fb_info.phone, FB_CURSOR_VISIBILITY, 1); 
+	nsend_call(fb_info.phone, FB_CLEAR, 0); 
 	
 	/* Init virtual consoles */
@@ -350,16 +354,15 @@
 	if ((interbuffer = mmap(NULL, sizeof(keyfield_t) * fb_info.cols * fb_info.rows , PROTO_READ|PROTO_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, 0 ,0 )) != NULL) {
 		if (ipc_call_sync_3(fb_info.phone, IPC_M_AS_AREA_SEND, (ipcarg_t)interbuffer, 0, AS_AREA_READ | AS_AREA_CACHEABLE, NULL, NULL, NULL) != 0) {
-//			ipc_call_async_3(fb_info.phone, FB_PUTCHAR, '?', 10, 10, NULL, NULL);
 			munmap(interbuffer, sizeof(keyfield_t) * fb_info.cols * fb_info.rows);
 			interbuffer = NULL;
 		}
-/*	} else {
-		ipc_call_async_3(fb_info.phone, FB_PUTCHAR, '!', 10, 10, NULL, NULL);
-*/
-	}
+	}
+
+	/* FIXME: save kernel console screen */
 	
 	async_new_connection(phonehash, 0, NULL, keyboard_events);
 	
 	nsend_call_2(fb_info.phone, FB_CURSOR_GOTO, 0, 0); 
+	nsend_call(fb_info.phone, FB_CURSOR_VISIBILITY, 1); 
 
 	/* Register at NS */
@@ -372,2 +375,3 @@
 	return 0;	
 }
+
