Index: console/console.c
===================================================================
--- console/console.c	(revision 440cff5066a77721ed225429e12f30fe0a6715eb)
+++ console/console.c	(revision b27a97bb30fc0f831ab37f52c45321ec3d904ca4)
@@ -100,6 +100,9 @@
 		case KBD_PUSHCHAR:
 			/* got key from keyboard driver */
+			
 			/* find active console */
+			
 			/* if client is awaiting key, send it */
+			
 			/*FIXME: else store key to its buffer */
 			retval = 0;
@@ -113,5 +116,5 @@
 			/* Send it to first FB, DEBUG */
 //			ipc_call_async_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL);
-			ipc_call_sync_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL);
+//			ipc_call_sync_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL);
 
 			break;
@@ -149,17 +152,18 @@
 			return;
 		case CONSOLE_PUTCHAR:
-			/* TODO: send message to fb */
+			/* Send message to fb */
 			ipc_call_async_2(connections[consnum].vfb_phone, FB_PUTCHAR, IPC_GET_ARG1(call), IPC_GET_ARG2(call), NULL, NULL); 
 			break;
 		case CONSOLE_GETCHAR:
-			/* FIXME: */
-			if (!keybuffer_pop(&(connections[active_client].keybuffer), (char *)&arg1)) {
+			/* FIXME: Only temporary solution until request storage will be created  */
+			
+			while (!keybuffer_pop(&(connections[active_client].keybuffer), (char *)&arg1)) {
 				/* FIXME: buffer empty -> store request */
-				arg1 = 'X'; /* Only temporary */
+				usleep(10000);
 			};
-//ipc_call_async_2(connections[active_client].vfb_phone, FB_PUTCHAR, ' ', arg1, NULL, (void *)NULL); 
+			
 			break;
 		}
-		ipc_answer_fast(callid, 0,0,0);
+		ipc_answer_fast(callid, 0, arg1, 0);
 	}
 }
@@ -190,6 +194,6 @@
 		/* TODO: init key_buffer */
 		while ((connections[i].vfb_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) {
-				
-			ipc_call_async_2(connections[i].vfb_phone, FB_PUTCHAR, 'a', 'b', NULL, (void *)NULL); 
+			usleep(10000);
+			//ipc_call_async_2(connections[i].vfb_phone, FB_PUTCHAR, 'a', 'b', NULL, (void *)NULL); 
 		}
 	}
Index: init/init.c
===================================================================
--- init/init.c	(revision 440cff5066a77721ed225429e12f30fe0a6715eb)
+++ init/init.c	(revision b27a97bb30fc0f831ab37f52c45321ec3d904ca4)
@@ -416,4 +416,13 @@
 }
 
+static void test_console(void)
+{
+	int c;
+
+	while ((c = getchar()) != EOF)
+		putchar(c);
+}
+
+
 int main(int argc, char *argv[])
 {
@@ -423,4 +432,6 @@
 //	version_print();
 
+	printf("Hello\nThis is Init\n");
+	
 //	test_printf();
 //	test_printf2();
@@ -437,7 +448,7 @@
 //	test_async_kbd();
 //	test_fb();
-
-	printf("Hello\nThis is Init\n\nBye.");
-	
+	test_console();
+
+	printf("\nBye.\n");
 
 /*	
Index: libc/generic/io/io.c
===================================================================
--- libc/generic/io/io.c	(revision 440cff5066a77721ed225429e12f30fe0a6715eb)
+++ libc/generic/io/io.c	(revision b27a97bb30fc0f831ab37f52c45321ec3d904ca4)
@@ -93,2 +93,14 @@
 	return EOF;
 }
+
+int getchar(void)
+{
+	unsigned char c;
+	if (read(0, (void *)&c , 1) == 1) {
+			return c;
+	}
+	
+	return EOF;
+}
+
+
Index: libc/generic/io/stream.c
===================================================================
--- libc/generic/io/stream.c	(revision 440cff5066a77721ed225429e12f30fe0a6715eb)
+++ libc/generic/io/stream.c	(revision b27a97bb30fc0f831ab37f52c45321ec3d904ca4)
@@ -1,2 +1,32 @@
+/*
+ * Copyright (C) 2006 Josef Cejka
+ * Copyright (C) 2006 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 <io/io.h>
 #include <io/stream.h>
@@ -9,4 +39,5 @@
 #include <ipc/services.h>
 #include <console.h>
+#include <unistd.h>
 
 #define FDS 32
@@ -35,12 +66,19 @@
 }
 
-static char read_stdin(void)
+static ssize_t read_stdin(void *param, void *buf, size_t count)
 {
 	ipcarg_t r0,r1;
-	ipc_call_sync_2(console_phone, CONSOLE_GETCHAR, 0, 0, &r0, &r1);
-	
-	return r0;
+	size_t i = 0;
+
+	while (i < count) {
+		if (ipc_call_sync_2(console_phone, CONSOLE_GETCHAR, 0, 0, &r0, &r1) < 0) {
+			return -1;
+		}
+		((char *)buf)[i++] = r0;
+	}
+	return i;
 	//return (ssize_t) __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, (sysarg_t) count);
 }
+
 static ssize_t write_stdout(void *param, const void *buf, size_t count)
 {
@@ -126,2 +164,11 @@
 	return 0;
 }
+
+ssize_t read(int fd, void *buf, size_t count)
+{
+	if (fd < FDS)
+		return streams[fd].r(streams[fd].param, buf, count);
+	
+	return 0;
+}
+
Index: libc/include/io/io.h
===================================================================
--- libc/include/io/io.h	(revision 440cff5066a77721ed225429e12f30fe0a6715eb)
+++ libc/include/io/io.h	(revision b27a97bb30fc0f831ab37f52c45321ec3d904ca4)
@@ -35,4 +35,5 @@
 int putstr(const char * str);
 int putchar(int c);
+int getchar(void);
 
 #endif
Index: libc/include/io/stream.h
===================================================================
--- libc/include/io/stream.h	(revision 440cff5066a77721ed225429e12f30fe0a6715eb)
+++ libc/include/io/stream.h	(revision b27a97bb30fc0f831ab37f52c45321ec3d904ca4)
@@ -1,4 +1,31 @@
+/*
+ * Copyright (C) 2006 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 <libarch/types.h>
-#include <unistd.h>
 
 #define EMFILE -17
@@ -8,5 +35,5 @@
 
 typedef ssize_t (*pwritefn_t)(void *, const void *, size_t);
-typedef char (*preadfn_t)(void);
+typedef ssize_t (*preadfn_t)(void *, void *, size_t);
 
 fd_t open(const char *fname, int flags);
Index: libc/include/stdio.h
===================================================================
--- libc/include/stdio.h	(revision 440cff5066a77721ed225429e12f30fe0a6715eb)
+++ libc/include/stdio.h	(revision b27a97bb30fc0f831ab37f52c45321ec3d904ca4)
@@ -35,4 +35,6 @@
 #define EOF (-1)
 
+extern int getchar(void);
+
 extern int puts(const char * str);
 extern int putchar(int c);
Index: libc/include/unistd.h
===================================================================
--- libc/include/unistd.h	(revision 440cff5066a77721ed225429e12f30fe0a6715eb)
+++ libc/include/unistd.h	(revision b27a97bb30fc0f831ab37f52c45321ec3d904ca4)
@@ -37,4 +37,5 @@
 
 extern ssize_t write(int fd, const void * buf, size_t count);
+extern ssize_t read(int fd, void * buf, size_t count);
 extern void _exit(int status);
 void *sbrk(ssize_t incr);
