Index: uspace/srv/sysman/Makefile
===================================================================
--- uspace/srv/sysman/Makefile	(revision 4fe7fcb3161434c48a85b2f498934246ecca5978)
+++ uspace/srv/sysman/Makefile	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -29,4 +29,5 @@
 
 USPACE_PREFIX = ../..
+EXTRA_CFLAGS = -I. -I./units
 BINARY = sysman
 STATIC_NEEDED = y
@@ -38,5 +39,8 @@
 	main.c \
 	sysman.c \
-	unit.c
+	unit.c \
+	units/unit_cfg.c \
+	units/unit_mnt.c  \
+	units/unit_tgt.c
 
 include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/sysman/configuration.c
===================================================================
--- uspace/srv/sysman/configuration.c	(revision 4fe7fcb3161434c48a85b2f498934246ecca5978)
+++ uspace/srv/sysman/configuration.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -5,4 +5,5 @@
 
 #include "configuration.h"
+#include "log.h"
 
 static list_t units;
@@ -17,4 +18,5 @@
 int configuration_add_unit(unit_t *unit)
 {
+	sysman_log(LVL_DEBUG2, "%s(%p)", __func__, unit);
 	assert(unit);
 	assert(unit->state == STATE_EMBRYO);
@@ -31,4 +33,6 @@
 int configuration_commit(void)
 {
+	sysman_log(LVL_DEBUG2, "%s", __func__);
+
 	fibril_mutex_lock(&units_mtx);
 	list_foreach(units, units, unit_t, u) {
Index: uspace/srv/sysman/job.c
===================================================================
--- uspace/srv/sysman/job.c	(revision 4fe7fcb3161434c48a85b2f498934246ecca5978)
+++ uspace/srv/sysman/job.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -8,4 +8,5 @@
 
 #include "job.h"
+#include "log.h"
 #include "unit.h"
 
@@ -19,4 +20,5 @@
 static int job_run_start(job_t *job)
 {
+	sysman_log(LVL_DEBUG, "%s(%p)", __func__, job);
 	unit_t *unit = job->unit;
 
Index: uspace/srv/sysman/job.h
===================================================================
--- uspace/srv/sysman/job.h	(revision 4fe7fcb3161434c48a85b2f498934246ecca5978)
+++ uspace/srv/sysman/job.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -25,4 +25,5 @@
 } job_link_t;
 
+/** Job represents pending or running operation on unit */
 struct job {
 	/** Link to queue job is in */
Index: uspace/srv/sysman/log.h
===================================================================
--- uspace/srv/sysman/log.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
+++ uspace/srv/sysman/log.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -0,0 +1,13 @@
+#ifndef SYSMAN_LOG_H
+#define SYSMAN_LOG_H
+
+#include <io/log.h>
+#include <stdio.h>
+
+/*
+ * Temporarily use only simple printfs, later add some smart logging,
+ * that would use logger as soon as it's ready.
+ */
+#define sysman_log(level, fmt, ...) printf("sysman: " fmt "\n", __VA_ARGS__)
+
+#endif
Index: uspace/srv/sysman/main.c
===================================================================
--- uspace/srv/sysman/main.c	(revision 4fe7fcb3161434c48a85b2f498934246ecca5978)
+++ uspace/srv/sysman/main.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -4,4 +4,5 @@
 #include <stddef.h>
 #include <stdio.h>
+#include <str.h>
 
 #include "configuration.h"
@@ -21,4 +22,7 @@
 	/*
 	 * Build hard coded configuration.
+	 *
+	 * Strings are allocated on heap, so that they can be free'd by an
+	 * owning unit.
 	 */
 	int result = EOK;
@@ -33,7 +37,7 @@
 	}
 	// TODO Use RDFMT
-	mnt_initrd->data.mnt.type       = "ext4fs";
-	mnt_initrd->data.mnt.mountpoint = "/";
-	mnt_initrd->data.mnt.device     = "bd/initrd";
+	mnt_initrd->data.mnt.type       = str_dup("ext4fs");
+	mnt_initrd->data.mnt.mountpoint = str_dup("/");
+	mnt_initrd->data.mnt.device     = str_dup("bd/initrd");
 
 	cfg_init = unit_create(UNIT_CONFIGURATION);
@@ -42,5 +46,5 @@
 		goto fail;
 	}
-	cfg_init->data.cfg.path = "/cfg/";
+	cfg_init->data.cfg.path = str_dup("/cfg/");
 	
 	tgt_default = unit_create(UNIT_TARGET);
Index: uspace/srv/sysman/unit.c
===================================================================
--- uspace/srv/sysman/unit.c	(revision 4fe7fcb3161434c48a85b2f498934246ecca5978)
+++ uspace/srv/sysman/unit.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -6,5 +6,13 @@
 #include <stdlib.h>
 
+#include "log.h"
 #include "unit.h"
+
+/** Virtual method table for each unit type */
+static unit_ops_t *unit_type_vmts[] = {
+	[UNIT_TARGET]        = &unit_tgt_ops,
+	[UNIT_MOUNT]         = &unit_mnt_ops,
+	[UNIT_CONFIGURATION] = &unit_cfg_ops
+};
 
 static void unit_init(unit_t *unit, unit_type_t type)
@@ -12,4 +20,5 @@
 	assert(unit);
 
+	memset(unit, 0, sizeof(unit_t));
 	link_initialize(&unit->units);
 	
@@ -21,4 +30,6 @@
 	list_initialize(&unit->dependants);
 	list_initialize(&unit->dependencies);
+
+	unit_type_vmts[unit->type]->init(unit);
 }
 
@@ -33,16 +44,26 @@
 
 /** Release resources used by unit structure */
-void unit_destroy(unit_t **unit)
+void unit_destroy(unit_t **unit_ptr)
 {
-	if (*unit == NULL)
+	unit_t *unit = *unit_ptr;
+	if (unit == NULL)
 		return;
+
+	unit_type_vmts[unit->type]->destroy(unit);
 	/* TODO:
 	 * 	edges,
-	 * 	specific unit data,
 	 * 	check it's not an active unit,
 	 * 	other resources to come
 	 */
-	free(*unit);
-	*unit = NULL;
+	free(unit);
+	unit_ptr = NULL;
+}
+
+void unit_set_state(unit_t *unit, unit_state_t state)
+{
+	fibril_mutex_lock(&unit->state_mtx);
+	unit->state = state;
+	fibril_condvar_broadcast(&unit->state_cv);
+	fibril_mutex_unlock(&unit->state_mtx);
 }
 
@@ -54,6 +75,5 @@
 int unit_start(unit_t *unit)
 {
-	// TODO actually start the unit
-	printf("Starting unit of type %i\n", unit->type);
-	return EOK;
+	sysman_log(LVL_DEBUG, "%s(%p)", __func__, unit);
+	return unit_type_vmts[unit->type]->start(unit);
 }
Index: uspace/srv/sysman/unit.h
===================================================================
--- uspace/srv/sysman/unit.h	(revision 4fe7fcb3161434c48a85b2f498934246ecca5978)
+++ uspace/srv/sysman/unit.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -7,18 +7,8 @@
 #include "unit_mnt.h"
 #include "unit_cfg.h"
+#include "unit_tgt.h"
+#include "unit_types.h"
 
-typedef enum {
-	UNIT_TARGET = 0,
-	UNIT_MOUNT,
-	UNIT_CONFIGURATION
-} unit_type_t;
-
-typedef enum {
-	STATE_EMBRYO = 0,
-	STATE_STARTED,
-	STATE_STOPPED
-} unit_state_t;
-
-typedef struct {
+struct unit {
 	link_t units;
 
@@ -36,5 +26,5 @@
 		unit_cfg_t cfg;
 	} data;
-} unit_t;
+};
 
 
@@ -42,4 +32,7 @@
 extern void unit_destroy(unit_t **);
 
+// TODO add flags argument with explicit notification?
+extern void unit_set_state(unit_t *, unit_state_t);
+
 extern int unit_start(unit_t *);
 
Index: pace/srv/sysman/unit_cfg.h
===================================================================
--- uspace/srv/sysman/unit_cfg.h	(revision 4fe7fcb3161434c48a85b2f498934246ecca5978)
+++ 	(revision )
@@ -1,8 +1,0 @@
-#ifndef SYSMAN_UNIT_CFG_H
-#define SYSMAN_UNIT_CFG_H
-
-typedef struct {
-	const char *path;
-} unit_cfg_t;
-
-#endif
Index: pace/srv/sysman/unit_mnt.h
===================================================================
--- uspace/srv/sysman/unit_mnt.h	(revision 4fe7fcb3161434c48a85b2f498934246ecca5978)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#ifndef SYSMAN_UNIT_MNT_H
-#define SYSMAN_UNIT_MNT_H
-
-typedef struct {
-	const char *type;
-	const char *mountpoint;
-	const char *device;
-} unit_mnt_t;
-
-#endif
-
Index: uspace/srv/sysman/unit_types.h
===================================================================
--- uspace/srv/sysman/unit_types.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
+++ uspace/srv/sysman/unit_types.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -0,0 +1,37 @@
+#ifndef SYSMAN_UNIT_TYPES_H
+#define SYSMAN_UNIT_TYPES_H
+
+struct unit;
+typedef struct unit unit_t;
+
+typedef enum {
+	UNIT_TARGET = 0,
+	UNIT_MOUNT,
+	UNIT_CONFIGURATION
+} unit_type_t;
+
+typedef enum {
+	STATE_EMBRYO = 0,
+	STATE_STARTING,
+	STATE_STARTED,
+	STATE_STOPPED,
+	STATE_FAILED
+} unit_state_t;
+
+typedef struct {
+	void (*init)(unit_t *);
+
+	int (*start)(unit_t *);
+
+	void (*destroy)(unit_t *);
+
+} unit_ops_t;
+
+#define DEFINE_UNIT_OPS(PREFIX)                                      \
+	unit_ops_t PREFIX##_ops = {                                  \
+		.init    = &PREFIX##_init,                           \
+		.start   = &PREFIX##_start,                          \
+		.destroy = &PREFIX##_destroy                         \
+	};
+
+#endif
Index: uspace/srv/sysman/units/unit_cfg.c
===================================================================
--- uspace/srv/sysman/units/unit_cfg.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
+++ uspace/srv/sysman/units/unit_cfg.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -0,0 +1,23 @@
+#include <errno.h>
+
+#include "unit_cfg.h"
+
+static void unit_cfg_init(unit_t *unit)
+{
+	// TODO
+}
+
+static int unit_cfg_start(unit_t *unit)
+{
+	//TODO
+	return EOK;
+}
+
+static void unit_cfg_destroy(unit_t *unit)
+{
+	//TODO
+}
+
+
+DEFINE_UNIT_OPS(unit_cfg)
+
Index: uspace/srv/sysman/units/unit_cfg.h
===================================================================
--- uspace/srv/sysman/units/unit_cfg.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
+++ uspace/srv/sysman/units/unit_cfg.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -0,0 +1,12 @@
+#ifndef SYSMAN_UNIT_CFG_H
+#define SYSMAN_UNIT_CFG_H
+
+#include "unit_types.h"
+
+typedef struct {
+	const char *path;
+} unit_cfg_t;
+
+extern unit_ops_t unit_cfg_ops;
+
+#endif
Index: uspace/srv/sysman/units/unit_mnt.c
===================================================================
--- uspace/srv/sysman/units/unit_mnt.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
+++ uspace/srv/sysman/units/unit_mnt.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -0,0 +1,56 @@
+#include <assert.h>
+#include <errno.h>
+#include <fibril_synch.h>
+#include <stdlib.h>
+#include <vfs/vfs.h>
+
+#include "log.h"
+#include "unit.h"
+#include "unit_mnt.h"
+
+static void unit_mnt_init(unit_t *unit)
+{
+	assert(unit->data.mnt.type == NULL);
+	assert(unit->data.mnt.mountpoint == NULL);
+	assert(unit->data.mnt.device == NULL);
+}
+
+static int unit_mnt_start(unit_t *unit)
+{
+	fibril_mutex_lock(&unit->state_mtx);
+	
+	// TODO think about unit's lifecycle (is STOPPED only acceptable?)
+	assert(unit->state == STATE_STOPPED);
+	unit->state = STATE_STARTING;
+	
+	fibril_condvar_broadcast(&unit->state_cv);
+	fibril_mutex_unlock(&unit->state_mtx);
+
+
+	unit_mnt_t *data = &unit->data.mnt;
+
+	// TODO use other mount parameters
+	int rc = mount(data->type, data->mountpoint, data->device, "",
+	    IPC_FLAG_BLOCKING, 0);
+
+	if (rc == EOK) {
+		sysman_log(LVL_NOTE, "Mount (%p) mounted", unit);
+		unit_set_state(unit, STATE_STARTED);
+	} else {
+		sysman_log(LVL_ERROR, "Mount (%p) failed (%i)", unit, rc);
+		unit_set_state(unit, STATE_FAILED);
+	}
+
+	return rc;
+}
+
+static void unit_mnt_destroy(unit_t *unit)
+{
+	free(unit->data.mnt.type);
+	free(unit->data.mnt.mountpoint);
+	free(unit->data.mnt.device);
+}
+
+
+DEFINE_UNIT_OPS(unit_mnt)
+
Index: uspace/srv/sysman/units/unit_mnt.h
===================================================================
--- uspace/srv/sysman/units/unit_mnt.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
+++ uspace/srv/sysman/units/unit_mnt.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -0,0 +1,16 @@
+#ifndef SYSMAN_UNIT_MNT_H
+#define SYSMAN_UNIT_MNT_H
+
+#include "unit_types.h"
+
+typedef struct {
+	const char *type;
+	const char *mountpoint;
+	const char *device;
+} unit_mnt_t;
+
+extern unit_ops_t unit_mnt_ops;
+
+
+#endif
+
Index: uspace/srv/sysman/units/unit_tgt.c
===================================================================
--- uspace/srv/sysman/units/unit_tgt.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
+++ uspace/srv/sysman/units/unit_tgt.c	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -0,0 +1,23 @@
+#include <errno.h>
+
+#include "unit_tgt.h"
+
+static void unit_tgt_init(unit_t *unit)
+{
+	// TODO
+}
+
+static int unit_tgt_start(unit_t *unit)
+{
+	//TODO
+	return EOK;
+}
+
+static void unit_tgt_destroy(unit_t *unit)
+{
+	//TODO
+}
+
+
+DEFINE_UNIT_OPS(unit_tgt)
+
Index: uspace/srv/sysman/units/unit_tgt.h
===================================================================
--- uspace/srv/sysman/units/unit_tgt.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
+++ uspace/srv/sysman/units/unit_tgt.h	(revision 6efec7e3724016bbb7204cba04cd589bc4cdc07d)
@@ -0,0 +1,8 @@
+#ifndef SYSMAN_UNIT_TGT_H
+#define SYSMAN_UNIT_TGT_H
+
+#include "unit_types.h"
+
+extern unit_ops_t unit_tgt_ops;
+
+#endif
