Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision e2b9a993a065ba9a3b546b85bf86e5466f3f8d06)
+++ boot/Makefile.common	(revision 08d9c4e6d721642eed91d99f8760f47351b6aaff)
@@ -47,4 +47,5 @@
 
 RD_SRVS = \
+	$(USPACEDIR)/srv/devman/devman \
 	$(USPACEDIR)/srv/bd/file_bd/file_bd \
 	$(USPACEDIR)/srv/bd/part/guid_part/g_part \
Index: uspace/app/init/init.c
===================================================================
--- uspace/app/init/init.c	(revision e2b9a993a065ba9a3b546b85bf86e5466f3f8d06)
+++ uspace/app/init/init.c	(revision 08d9c4e6d721642eed91d99f8760f47351b6aaff)
@@ -315,5 +315,7 @@
 
 	usleep(1000000);
-	spawn("/srv/dd");
+	//spawn("/srv/dd");
+	
+	srv_start("/srv/devman");	
 	
 	return 0;
Index: uspace/srv/devman/devman.c
===================================================================
--- uspace/srv/devman/devman.c	(revision e2b9a993a065ba9a3b546b85bf86e5466f3f8d06)
+++ uspace/srv/devman/devman.c	(revision 08d9c4e6d721642eed91d99f8760f47351b6aaff)
@@ -41,7 +41,9 @@
 driver_t * create_driver() 
 {
+	printf(NAME ": create_driver\n");
+	
 	driver_t *res = malloc(sizeof(driver_t));
 	if(res != NULL) {
-		clean_driver(res);
+		init_driver(res);
 	}
 	return res;
@@ -102,4 +104,6 @@
 bool read_match_ids(const char *conf_path, match_id_list_t *ids) 
 {	
+	printf(NAME ": read_match_ids conf_path = %s.\n", conf_path);
+	
 	bool suc = false;	
 	char *buf = NULL;
@@ -150,4 +154,6 @@
 bool get_driver_info(const char *base_path, const char *name, driver_t *drv)
 {
+	printf(NAME ": get_driver_info base_path = %s, name = %s.\n", base_path, name);
+	
 	assert(base_path != NULL && name != NULL && drv != NULL);
 	
@@ -160,4 +166,6 @@
 		goto cleanup;
 	}	
+	
+	printf(NAME ": get_driver_info - path to match id list = %s.\n", match_path);
 	
 	if (!read_match_ids(match_path, &drv->match_ids)) {
@@ -208,4 +216,6 @@
 int lookup_available_drivers(link_t *drivers_list, const char *dir_path)
 {
+	printf(NAME ": lookup_available_drivers \n");
+	
 	int drv_cnt = 0;
 	DIR *dir = NULL;
@@ -213,9 +223,13 @@
 
 	dir = opendir(dir_path);
+	printf(NAME ": lookup_available_drivers has opened directory %s for driver search.\n", dir_path);
+	
 	if (dir != NULL) {
 		driver_t *drv = create_driver();
+		printf(NAME ": lookup_available_drivers has created driver structure.\n");
 		while ((diren = readdir(dir))) {			
 			if (get_driver_info(dir_path, diren->d_name, drv)) {
 				add_driver(drivers_list, drv);
+				drv_cnt++;
 				drv = create_driver();
 			}	
@@ -318,4 +332,5 @@
 bool init_device_tree(dev_tree_t *tree, link_t *drivers_list)
 {
+	printf(NAME ": init_device_tree.");
 	// create root node and add it to the device tree
 	if (NULL == (tree->root_node = create_root_node())) {
Index: uspace/srv/devman/devman.h
===================================================================
--- uspace/srv/devman/devman.h	(revision e2b9a993a065ba9a3b546b85bf86e5466f3f8d06)
+++ uspace/srv/devman/devman.h	(revision 08d9c4e6d721642eed91d99f8760f47351b6aaff)
@@ -30,5 +30,5 @@
  * @{
  */
- 
+
 #ifndef DEVMAN_H_
 #define DEVMAN_H_
@@ -41,4 +41,5 @@
 #include <ipc/ipc.h>
 
+#include "util.h"
 
 #define NAME "devman"
@@ -97,14 +98,14 @@
 	node_t *parent;
 	/** Pointers to previous and next child devices in the linked list of parent device's node.*/
-	link_t sibling;	
+	link_t sibling;
 	/** List of child device nodes. */
 	link_t children;
 	/** List of device ids for device-to-driver matching.*/
-	match_id_list_t match_ids;	
+	match_id_list_t match_ids;
 	/** Driver of this device.*/
-	driver_t *drv;	
+	driver_t *drv;
 	/** Pointer to the previous and next device in the list of devices
 	    owned by one driver */
-	link_t driver_devices;	
+	link_t driver_devices;
 };
 
@@ -130,15 +131,17 @@
 
 
-static inline match_id_t * create_match_id() 
+static inline match_id_t * create_match_id()
 {
 	match_id_t *id = malloc(sizeof(match_id_t));
 	memset(id, 0, sizeof(match_id_t));
-	return id;	
-}
-
-static inline void delete_match_id(match_id_t *id) 
-{
-	free(id->id);
-	free(id);
+	return id;
+}
+
+static inline void delete_match_id(match_id_t *id)
+{
+	if (id) {
+		free_not_null(id->id);
+		free(id);
+	}
 }
 
@@ -152,32 +155,37 @@
 bool assign_driver(node_t *node, link_t *drivers_list);
 
-void attach_driver(node_t *node, driver_t *drv); 
+void attach_driver(node_t *node, driver_t *drv);
 bool add_device(driver_t *drv, node_t *node);
 bool start_driver(driver_t *drv);
 
 
-static inline void init_driver(driver_t *drv) 
-{
-	assert(drv != NULL);	
-	
-	memset(drv, 0, sizeof(driver_t));	
+static inline void init_driver(driver_t *drv)
+{
+	printf(NAME ": init_driver\n");
+	assert(drv != NULL);
+
+	memset(drv, 0, sizeof(driver_t));
 	list_initialize(&drv->match_ids.ids);
 	list_initialize(&drv->devices);
 }
 
-static inline void clean_driver(driver_t *drv) 
-{
+static inline void clean_driver(driver_t *drv)
+{
+	printf(NAME ": clean_driver\n");
 	assert(drv != NULL);
+
+	free_not_null(drv->name);
+	free_not_null(drv->binary_path); 
+
+	clean_match_ids(&drv->match_ids);
+
+	init_driver(drv);
+}
+
+static inline void delete_driver(driver_t *drv)
+{
+	printf(NAME ": delete_driver\n");
+	assert(NULL != drv);
 	
-	free(drv->name);
-	free(drv->binary_path);
-	
-	clean_match_ids(&drv->match_ids);
-	
-	init_driver(drv);	
-}
-
-static inline void delete_driver(driver_t *drv) 
-{
 	clean_driver(drv);
 	free(drv);
@@ -187,5 +195,5 @@
 {
 	list_prepend(&drv->drivers, drivers_list);
-	printf(NAME": the '%s' driver was added to the list of available drivers.\n", drv->name);	
+	printf(NAME": the '%s' driver was added to the list of available drivers.\n", drv->name);
 }
 
@@ -198,21 +206,21 @@
 	node_t *res = malloc(sizeof(node_t));
 	if (res != NULL) {
-		memset(res, 0, sizeof(node_t));	
+		memset(res, 0, sizeof(node_t));
 	}
 	return res;
 }
 
-static inline void init_dev_node(node_t *node, node_t *parent) 
+static inline void init_dev_node(node_t *node, node_t *parent)
 {
 	assert(NULL != node);
-	
+
 	node->parent = parent;
 	if (NULL != parent) {
 		list_append(&node->sibling, &parent->children);
 	}
-	
+
 	list_initialize(&node->children);
-	
-	list_initialize(&node->match_ids.ids);	
+
+	list_initialize(&node->match_ids.ids);
 }
 
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision e2b9a993a065ba9a3b546b85bf86e5466f3f8d06)
+++ uspace/srv/devman/main.c	(revision 08d9c4e6d721642eed91d99f8760f47351b6aaff)
@@ -92,4 +92,6 @@
 static bool devman_init()
 {
+	printf(NAME ": devman_init - looking for available drivers. \n");
+	
 	// initialize list of available drivers
 	if (0 == lookup_available_drivers(&drivers_list, DRIVER_DEFAULT_STORE)) {
@@ -97,4 +99,5 @@
 		return false;
 	}
+	printf(NAME ": devman_init  - list of drivers has been initialized. \n");
 
 	// create root device node 
Index: uspace/srv/devman/util.c
===================================================================
--- uspace/srv/devman/util.c	(revision e2b9a993a065ba9a3b546b85bf86e5466f3f8d06)
+++ uspace/srv/devman/util.c	(revision 08d9c4e6d721642eed91d99f8760f47351b6aaff)
@@ -41,5 +41,5 @@
 	char *res;
 	int base_len = str_size(base_path);
-	int size = base_len + str_size(name) + str_size(ext) + 3;	
+	int size = base_len + 2*str_size(name) + str_size(ext) + 3;	
 	
 	res = malloc(size);
@@ -51,4 +51,6 @@
 		}
 		str_append(res, size, name);
+		str_append(res, size, "/");
+		str_append(res, size, name);
 		if(ext[0] != '.') {
 			str_append(res, size, ".");
Index: uspace/srv/devman/util.h
===================================================================
--- uspace/srv/devman/util.h	(revision e2b9a993a065ba9a3b546b85bf86e5466f3f8d06)
+++ uspace/srv/devman/util.h	(revision 08d9c4e6d721642eed91d99f8760f47351b6aaff)
@@ -57,3 +57,10 @@
 }
 
+static inline void free_not_null(void *ptr)
+{
+	if (NULL != ptr) {
+		free(ptr);
+	}
+}
+
 #endif
