Index: uspace/app/bdsh/Makefile
===================================================================
--- uspace/app/bdsh/Makefile	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ uspace/app/bdsh/Makefile	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -48,4 +48,6 @@
 	cmds/modules/cp/cp.c \
 	cmds/modules/mv/mv.c \
+	cmds/modules/printf/printf.c \
+	cmds/modules/echo/echo.c \
 	cmds/modules/mount/mount.c \
 	cmds/modules/unmount/unmount.c \
Index: uspace/app/bdsh/TODO
===================================================================
--- uspace/app/bdsh/TODO	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ uspace/app/bdsh/TODO	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -30,6 +30,4 @@
 * Add wrappers for signal, sigaction to make ports to modules easier
 
-* Add 'echo' and 'printf' modules.
-
 Regarding POSIX:
 ----------------
Index: uspace/app/bdsh/cmds/modules/echo/echo.c
===================================================================
--- uspace/app/bdsh/cmds/modules/echo/echo.c	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
+++ uspace/app/bdsh/cmds/modules/echo/echo.c	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2012 Alexander Prutkov
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+#include "util.h"
+#include "errors.h"
+#include "entry.h"
+#include "echo.h"
+#include "cmds.h"
+#include "errno.h"
+
+static const char *cmdname = "echo";
+
+void help_cmd_echo(unsigned int level)
+{
+	if (level == HELP_SHORT) {
+		printf("`%s' prints arguments as they are, followed by a new line.\n", cmdname);
+	} else {
+		help_cmd_echo(HELP_SHORT);
+		printf("Usage:  %s [arg ...]\n", cmdname);
+	}
+
+	return;
+}
+
+/* Main entry point for echo, accepts an array of arguments */
+int cmd_echo(char **argv)
+{
+	unsigned int argc;
+
+	for (argc = 1; argv[argc] != NULL; argc ++) {
+		printf("%s ", argv[argc]);
+	}
+	printf("\n");
+	return CMD_SUCCESS;
+
+}
+
Index: uspace/app/bdsh/cmds/modules/echo/echo.h
===================================================================
--- uspace/app/bdsh/cmds/modules/echo/echo.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
+++ uspace/app/bdsh/cmds/modules/echo/echo.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -0,0 +1,8 @@
+#ifndef ECHO_H
+#define ECHO_H
+
+/* Prototypes for the echo command, excluding entry points */
+
+
+#endif /* ECHO_H */
+
Index: uspace/app/bdsh/cmds/modules/echo/echo_def.h
===================================================================
--- uspace/app/bdsh/cmds/modules/echo/echo_def.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
+++ uspace/app/bdsh/cmds/modules/echo/echo_def.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -0,0 +1,7 @@
+{
+	"echo",
+	"Prints arguments as they are",
+	&cmd_echo,
+	&help_cmd_echo,
+},
+
Index: uspace/app/bdsh/cmds/modules/echo/entry.h
===================================================================
--- uspace/app/bdsh/cmds/modules/echo/entry.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
+++ uspace/app/bdsh/cmds/modules/echo/entry.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -0,0 +1,9 @@
+#ifndef ECHO_ENTRY_H
+#define ECHO_ENTRY_H
+
+/* Entry points for the echo command */
+extern int cmd_echo(char **);
+extern void help_cmd_echo(unsigned int);
+
+#endif /* ECHO_ENTRY_H */
+
Index: uspace/app/bdsh/cmds/modules/modules.h
===================================================================
--- uspace/app/bdsh/cmds/modules/modules.h	(revision 1dbe4654725ea80d44d0844ebe3093b1bbbcb4dd)
+++ uspace/app/bdsh/cmds/modules/modules.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -61,4 +61,6 @@
 #include "unmount/entry.h"
 #include "kcon/entry.h"
+#include "printf/entry.h"
+#include "echo/entry.h"
 
 /* Each .def function fills the module_t struct with the individual name, entry
@@ -82,4 +84,6 @@
 #include "unmount/unmount_def.h"
 #include "kcon/kcon_def.h"
+#include "printf/printf_def.h"
+#include "echo/echo_def.h"
 
 	{NULL, NULL, NULL, NULL}
Index: uspace/app/bdsh/cmds/modules/printf/TODO
===================================================================
--- uspace/app/bdsh/cmds/modules/printf/TODO	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
+++ uspace/app/bdsh/cmds/modules/printf/TODO	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -0,0 +1,13 @@
+At this stage printf is very young and limited, as it hopefully
+will be developed along with BDSH. Functionality is heavily related
+on libc printf already available. BDSH printf implements only 3 format  
+flags, with no options/precision/width modifiers allowed. Also, 
+one output control is available - '\n'. '\' character stands
+as an escape character, i.e. every special character after it 
+will be treated as general char and will be printed out.
+What's missing:
+ * Error checking for format string.
+ * Add more output controls (\t \r ...)
+ * Add width/precision options for number printings
+ * Add more format flags (%f %b ...)
+ 
Index: uspace/app/bdsh/cmds/modules/printf/entry.h
===================================================================
--- uspace/app/bdsh/cmds/modules/printf/entry.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
+++ uspace/app/bdsh/cmds/modules/printf/entry.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -0,0 +1,9 @@
+#ifndef PRINTF_ENTRY_H
+#define PRINTF_ENTRY_H
+
+/* Entry points for the printf command */
+extern int cmd_printf(char **);
+extern void help_cmd_printf(unsigned int);
+
+#endif /* PRINTF_ENTRY_H */
+
Index: uspace/app/bdsh/cmds/modules/printf/printf.c
===================================================================
--- uspace/app/bdsh/cmds/modules/printf/printf.c	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
+++ uspace/app/bdsh/cmds/modules/printf/printf.c	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2012 Alexander Prutkov
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+#include "util.h"
+#include "errors.h"
+#include "entry.h"
+#include "printf.h"
+#include "cmds.h"
+#include "str.h"
+
+static const char *cmdname = "printf";
+
+/* Dispays help for printf in various levels */
+void help_cmd_printf(unsigned int level)
+{
+	if (level == HELP_SHORT) {
+		printf("`%s' prints formatted data.\n", cmdname);
+	} else {
+		help_cmd_printf(HELP_SHORT);
+		printf(
+		    "Usage:  %s FORMAT [ARGS ...] \n"
+		    "Prints ARGS according to FORMAT. Number of expected arguments in\n"
+		    "FORMAT must be equals to the number of ARGS. Currently supported\n"
+		    "format flags are:\n",
+		    cmdname);
+	}
+
+	
+	return;
+}
+
+/** Print a formatted data with lib printf.
+ * 
+ * Currently available format flags are:
+ * '%d' - integer.
+ * '%u' - unsigned integer.
+ * '%s' - null-terminated string.
+ ***** 
+ * @param ch  formatted flag.
+ * @param arg string with data to print.
+ */
+static int print_arg(wchar_t ch, const char* arg)
+{
+	switch(ch) {
+	case 'd':
+		printf("%d", (int)(strtol(arg, NULL, 10)));
+		break;
+	case 'u':
+		printf("%u", (unsigned int)(strtoul(arg, NULL, 10)));
+		break;
+	case 's':
+		printf("%s", arg);
+		break;
+	default:
+		return CMD_FAILURE;
+	}
+	return CMD_SUCCESS;
+}
+
+/** Process a control character.
+ * 
+ * Currently available characters are:
+ * '\n' - new line.
+ ***** 
+ * @param ch  Control character.
+ */
+static int process_ctl(wchar_t ch)
+{
+	switch(ch) {
+	case 'n':
+		printf("\n");
+		break;
+	default:
+		return CMD_FAILURE;
+	}
+	return CMD_SUCCESS;
+}
+
+
+/** Prints formatted data. 
+ *
+ * Accepted format flags:
+ * %d - print an integer
+ * %u - print an unsigned integer
+ * %s - print a null terminated string
+ *****
+ * Accepted output controls:
+ * \n - new line
+ */
+int cmd_printf(char **argv)
+{
+	unsigned int argc;
+	char* fmt;
+	size_t pos, fmt_sz;
+	wchar_t ch;
+	bool esc_flag = false;
+	unsigned int carg;     // Current argument
+
+	/* Count the arguments */
+	for (argc = 0; argv[argc] != NULL; argc ++);
+
+	if (argc < 2) {
+		printf("Usage:  %s FORMAT [ARGS ...] \n", cmdname);
+		return CMD_SUCCESS;
+	}
+
+	fmt = argv[1];
+	fmt_sz = str_size(fmt);
+	pos = 0;
+	carg = 2;
+
+	while ((ch = str_decode(fmt, &pos, fmt_sz))) {
+		switch(ch) {
+
+		case '\\':
+			if (esc_flag) 
+				goto emit;
+			esc_flag = true;
+			break;
+
+		case '%':
+			if (esc_flag) 
+				goto emit;
+			ch = str_decode(fmt, &pos, fmt_sz);
+			if (!ch) { 
+				putchar('%');
+				break;
+			}
+			if (carg == argc) {
+				printf("\nBad parameter number. Aborted.\n");
+				return CMD_FAILURE;
+			}
+			print_arg(ch, argv[carg]);
+			++carg;
+			break;
+
+		default:
+			if (esc_flag) {
+				process_ctl(ch);
+				esc_flag = false;
+				break;
+			}
+			putchar(ch);	
+			break;
+
+		emit:
+			putchar(ch);
+			esc_flag = false;
+		}
+	}	
+
+	return CMD_SUCCESS;
+}
Index: uspace/app/bdsh/cmds/modules/printf/printf.h
===================================================================
--- uspace/app/bdsh/cmds/modules/printf/printf.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
+++ uspace/app/bdsh/cmds/modules/printf/printf.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -0,0 +1,8 @@
+#ifndef PRINTF_H
+#define PRINTF_H
+
+/* Prototypes for the printf command, excluding entry points */
+
+
+#endif /* PRINTF_H */
+
Index: uspace/app/bdsh/cmds/modules/printf/printf_def.h
===================================================================
--- uspace/app/bdsh/cmds/modules/printf/printf_def.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
+++ uspace/app/bdsh/cmds/modules/printf/printf_def.h	(revision f2b3d3ea3dc1fbb7a2312b326613bcc88a3bfaf5)
@@ -0,0 +1,7 @@
+{
+	"printf",
+	"Format and print data",
+	&cmd_printf,
+	&help_cmd_printf,
+},
+
