Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision 3a5909fe4bb88de08b53e63b8b853f35876cd30c)
+++ uspace/srv/devman/main.c	(revision 3843ecb7d7c7992f743d7917e8f23cddd7c7b5c9)
@@ -121,4 +121,11 @@
 }
 
+/**
+ * Receive device match ID from the device's parent driver and add it to the list of devices match ids.
+ * 
+ * @param match_ids the list of the device's match ids.
+ * 
+ * @return 0 on success, negative error code otherwise. 
+ */
 static int devman_receive_match_id(match_id_list_t *match_ids) {
 	
@@ -159,4 +166,13 @@
 }
 
+/**
+ * Receive device match IDs from the device's parent driver 
+ * and add them to the list of devices match ids.
+ * 
+ * @param match_count the number of device's match ids to be received.
+ * @param match_ids the list of the device's match ids.
+ * 
+ * @return 0 on success, negative error code otherwise.
+ */
 static int devman_receive_match_ids(ipcarg_t match_count, match_id_list_t *match_ids) 
 {	
@@ -171,5 +187,9 @@
 }
 
-static void devman_add_child(ipc_callid_t callid, ipc_call_t *call, driver_t *driver)
+/** Handle child device registration. 
+ * 
+ * Child devices are registered by their parent's device driver.
+ */
+static void devman_add_child(ipc_callid_t callid, ipc_call_t *call)
 {
 	// printf(NAME ": devman_add_child\n");
@@ -211,4 +231,10 @@
 }
 
+/**
+ * Initialize driver which has registered itself as running and ready.
+ * 
+ * The initialization is done in a separate fibril to avoid deadlocks 
+ * (if the driver needed to be served by devman during the driver's initialization). 
+ */
 static int init_running_drv(void *drv)
 {
@@ -219,6 +245,5 @@
 }
 
-/** Function for handling connections to device manager.
- *
+/** Function for handling connections from a driver to the device manager.
  */
 static void devman_connection_driver(ipc_callid_t iid, ipc_call_t *icall)
@@ -231,8 +256,11 @@
 		return;
 	
+	// Initialize the driver as running (e.g. pass assigned devices to it) in a separate fibril;
+	// the separate fibril is used to enable the driver 
+	// to use devman service during the driver's initialization.
 	fid_t fid = fibril_create(init_running_drv, driver);
 	if (fid == 0) {
 		printf(NAME ": Error creating fibril for the initialization of the newly registered running driver.\n");
-		exit(1);
+		return;
 	}
 	fibril_add_ready(fid);
@@ -254,5 +282,5 @@
 			continue;
 		case DEVMAN_ADD_CHILD_DEVICE:
-			devman_add_child(callid, &call, driver);
+			devman_add_child(callid, &call);
 			break;
 		default:
@@ -299,5 +327,6 @@
 	
 	if (driver->phone <= 0) {
-		printf(NAME ": devman_forward: cound not forward to driver %s (the driver's phone is %x).\n", driver->name, driver->phone);
+		printf(NAME ": devman_forward: cound not forward to driver %s ", driver->name);
+		printf("the driver's phone is %x).\n", driver->phone);
 		return;
 	}
Index: uspace/srv/drivers/pciintel/pci.c
===================================================================
--- uspace/srv/drivers/pciintel/pci.c	(revision 3a5909fe4bb88de08b53e63b8b853f35876cd30c)
+++ uspace/srv/drivers/pciintel/pci.c	(revision 3843ecb7d7c7992f743d7917e8f23cddd7c7b5c9)
@@ -58,6 +58,29 @@
 #define NAME "pciintel"
 
-
 #define CONF_ADDR(bus, dev, fn, reg)   ((1 << 31) | (bus << 16) | (dev << 11) | (fn << 8) | (reg & ~3))
+
+
+static hw_resource_list_t * pciintel_get_child_resources(device_t *dev)
+{
+	pci_dev_data_t *dev_data = (pci_dev_data_t *)dev->driver_data;
+	if (NULL == dev_data) {
+		return NULL;
+	}
+	return &dev_data->hw_resources;
+}
+
+static bool pciintel_enable_child_interrupt(device_t *dev) 
+{
+	// TODO
+	
+	return false;
+}
+
+static resource_iface_t pciintel_child_res_iface = {
+	&pciintel_get_child_resources,
+	&pciintel_enable_child_interrupt	
+};
+
+static device_class_t pci_child_class;
 
 
@@ -373,5 +396,5 @@
 			pci_read_interrupt(dev);
 			
-			// TODO initialize device interfaces			
+			dev->class = &pci_child_class;			
 			
 			printf(NAME ": adding new child device %s.\n", dev->name);
@@ -464,7 +487,14 @@
 }
 
+static void pciintel_init() 
+{
+	pci_child_class.id = 0; // TODO
+	pci_child_class.interfaces[HW_RES_DEV_IFACE] = &pciintel_child_res_iface;
+}
+
 int main(int argc, char *argv[])
 {
-	printf(NAME ": HelenOS pci bus driver (intel method 1).\n");	
+	printf(NAME ": HelenOS pci bus driver (intel method 1).\n");
+	pciintel_init();
 	return driver_main(&pci_driver);
 }
Index: uspace/srv/drivers/pciintel/pci.h
===================================================================
--- uspace/srv/drivers/pciintel/pci.h	(revision 3a5909fe4bb88de08b53e63b8b853f35876cd30c)
+++ uspace/srv/drivers/pciintel/pci.h	(revision 3843ecb7d7c7992f743d7917e8f23cddd7c7b5c9)
@@ -110,5 +110,5 @@
 }
 
-static inline bool pci_clean_resource_list(device_t *dev)
+static inline void pci_clean_resource_list(device_t *dev)
 {
 	pci_dev_data_t *dev_data = (pci_dev_data_t *)dev->driver_data;
Index: uspace/srv/drivers/rootia32/rootia32.c
===================================================================
--- uspace/srv/drivers/rootia32/rootia32.c	(revision 3a5909fe4bb88de08b53e63b8b853f35876cd30c)
+++ uspace/srv/drivers/rootia32/rootia32.c	(revision 3843ecb7d7c7992f743d7917e8f23cddd7c7b5c9)
@@ -51,4 +51,5 @@
 #include <ipc/dev_iface.h>
 #include <resource.h>
+#include <device/hw_res.h>
 
 #define NAME "rootia32"
@@ -111,4 +112,7 @@
 };
 
+// initialized in root_ia32_init() function
+static device_class_t rootia32_child_class;
+
 static bool rootia32_add_child(
 	device_t *parent, const char *name, const char *str_match_id, 
@@ -136,6 +140,6 @@
 	add_match_id(&child->match_ids, match_id);	
 	
-	// add an interface to the device
-	device_set_iface(child, HW_RES_DEV_IFACE, &child_res_iface);
+	// set class to the device
+	child->class = &rootia32_child_class;
 	
 	// register child  device
@@ -181,7 +185,14 @@
 }
 
+static void root_ia32_init() {
+	// initialize child device class		
+	rootia32_child_class.id = 0;	// TODO 
+	rootia32_child_class.interfaces[HW_RES_DEV_IFACE] = &child_res_iface;
+}
+
 int main(int argc, char *argv[])
 {
 	printf(NAME ": HelenOS root device driver\n");	
+	root_ia32_init();
 	return driver_main(&rootia32_driver);
 }
