Index: boot/Makefile.grub
===================================================================
--- boot/Makefile.grub	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ boot/Makefile.grub	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -89,5 +89,5 @@
 			echo "	$(MULTIBOOT_CMD) /boot/$$module" >> $(BOOT_CONFIG) ; \
 		else \
-			echo "	$(MODULE_CMD) /boot/$$module /boot/$$module" >> $(BOOT_CONFIG) ; \
+			echo "	$(MODULE_CMD) /boot/$$module" >> $(BOOT_CONFIG) ; \
 		fi \
 	done
Index: kernel/arch/amd64/src/boot/multiboot2.S
===================================================================
--- kernel/arch/amd64/src/boot/multiboot2.S	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ kernel/arch/amd64/src/boot/multiboot2.S	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -55,7 +55,5 @@
 		.long MULTIBOOT2_TAG_MODULE
 		.long MULTIBOOT2_TAG_MEMMAP
-#ifdef CONFIG_FB
 		.long MULTIBOOT2_TAG_FBINFO
-#endif
 	tag_info_req_end:
 	
@@ -87,5 +85,4 @@
 	tag_flags_end:
 	
-#ifdef CONFIG_FB
 	/* Framebuffer tag */
 	tag_framebuffer_start:
@@ -97,5 +94,4 @@
 		.long CONFIG_BFB_BPP
 	tag_framebuffer_end:
-#endif
 	
 	/* Module alignment tag */
Index: kernel/arch/ia32/src/boot/multiboot2.S
===================================================================
--- kernel/arch/ia32/src/boot/multiboot2.S	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ kernel/arch/ia32/src/boot/multiboot2.S	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -53,7 +53,5 @@
 		.long MULTIBOOT2_TAG_MODULE
 		.long MULTIBOOT2_TAG_MEMMAP
-#ifdef CONFIG_FB
 		.long MULTIBOOT2_TAG_FBINFO
-#endif
 	tag_info_req_end:
 	
@@ -85,5 +83,4 @@
 	tag_flags_end:
 	
-#ifdef CONFIG_FB
 	/* Framebuffer tag */
 	tag_framebuffer_start:
@@ -95,5 +92,4 @@
 		.long CONFIG_BFB_BPP
 	tag_framebuffer_end:
-#endif
 	
 	/* Module alignment tag */
Index: kernel/genarch/src/drivers/i8042/i8042.c
===================================================================
--- kernel/genarch/src/drivers/i8042/i8042.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ kernel/genarch/src/drivers/i8042/i8042.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -44,5 +44,4 @@
 #include <mm/slab.h>
 #include <ddi/device.h>
-#include <time/delay.h>
 
 #define i8042_SET_COMMAND  0x60
@@ -52,6 +51,4 @@
 #define i8042_BUFFER_FULL_MASK  0x01
 #define i8042_WAIT_MASK         0x02
-
-#define i8042_TIMEOUT  65536
 
 static irq_ownership_t i8042_claim(irq_t *irq)
@@ -80,24 +77,6 @@
 static void i8042_clear_buffer(i8042_t *dev)
 {
-	for (uint32_t i = 0; i < i8042_TIMEOUT; i++) {
-		if ((pio_read_8(&dev->status) & i8042_BUFFER_FULL_MASK) == 0)
-			break;
-		
+	while (pio_read_8(&dev->status) & i8042_BUFFER_FULL_MASK)
 		(void) pio_read_8(&dev->data);
-		delay(50);  /* 50 us think time */
-	}
-}
-
-static void i8042_send_command(i8042_t *dev, uint8_t cmd)
-{
-	for (uint32_t i = 0; i < i8042_TIMEOUT; i++) {
-		if ((pio_read_8(&dev->status) & i8042_WAIT_MASK) == 0)
-			break;
-		
-		delay(50);  /* 50 us think time */
-	}
-	
-	pio_write_8(&dev->status, cmd);
-	delay(10000);  /* 10 ms think time */
 }
 
@@ -105,6 +84,6 @@
 i8042_instance_t *i8042_init(i8042_t *dev, inr_t inr)
 {
-	i8042_instance_t *instance =
-	    malloc(sizeof(i8042_instance_t), FRAME_ATOMIC);
+	i8042_instance_t *instance
+	    = malloc(sizeof(i8042_instance_t), FRAME_ATOMIC);
 	if (instance) {
 		instance->i8042 = dev;
@@ -117,4 +96,5 @@
 		instance->irq.handler = i8042_irq_handler;
 		instance->irq.instance = instance;
+		
 	}
 	
@@ -127,8 +107,7 @@
 	ASSERT(kbrdin);
 	
-	i8042_clear_buffer(instance->i8042);
-	
 	instance->kbrdin = kbrdin;
 	irq_register(&instance->irq);
+	i8042_clear_buffer(instance->i8042);
 }
 
@@ -137,6 +116,9 @@
 {
 	interrupts_disable();
+	
 	i8042_clear_buffer(dev);
-	i8042_send_command(dev, i8042_CPU_RESET);
+	
+	/* Reset CPU */
+	pio_write_8(&dev->status, i8042_CPU_RESET);
 }
 
Index: kernel/genarch/src/fb/bfb.c
===================================================================
--- kernel/genarch/src/fb/bfb.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ kernel/genarch/src/fb/bfb.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -40,5 +40,5 @@
 #include <console/console.h>
 
-uintptr_t bfb_addr = 0;
+uintptr_t bfb_addr = (uintptr_t) -1;
 uint32_t bfb_width = 0;
 uint32_t bfb_height = 0;
@@ -57,6 +57,5 @@
 bool bfb_init(void)
 {
-	if ((bfb_addr == 0) || (bfb_width == 0) || (bfb_height == 0) ||
-	    (bfb_bpp == 0) || (bfb_scanline == 0))
+	if ((bfb_width == 0) || (bfb_height == 0))
 		return false;
 	
Index: kernel/genarch/src/multiboot/multiboot2.c
===================================================================
--- kernel/genarch/src/multiboot/multiboot2.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ kernel/genarch/src/multiboot/multiboot2.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -76,5 +76,4 @@
 static void multiboot2_fbinfo(const multiboot2_fbinfo_t *fbinfo)
 {
-#ifdef CONFIG_FB
 	if (fbinfo->visual == MULTIBOOT2_VISUAL_RGB) {
 		bfb_addr = fbinfo->addr;
@@ -93,5 +92,4 @@
 		bfb_blue_size = fbinfo->rgb.blue_size;
 	}
-#endif
 }
 
Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ kernel/generic/src/main/main.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -262,6 +262,6 @@
 	 * Create the first thread.
 	 */
-	thread_t *kinit_thread =
-	    thread_create(kinit, NULL, kernel, 0, "kinit", true);
+	thread_t *kinit_thread
+		= thread_create(kinit, NULL, kernel, 0, "kinit", true);
 	if (!kinit_thread)
 		panic("Cannot create kinit thread.");
Index: uspace/drv/bus/isa/isa.ma
===================================================================
--- uspace/drv/bus/isa/isa.ma	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/drv/bus/isa/isa.ma	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -1,1 +1,1 @@
-9 pci/ven=8086&dev=7000
+9 	pci/ven=8086&dev=7000
Index: uspace/drv/bus/usb/ehci/ehci.ma
===================================================================
--- uspace/drv/bus/usb/ehci/ehci.ma	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/drv/bus/usb/ehci/ehci.ma	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -1,1 +1,39 @@
-10 pci/class=0c&subclass=03&progif=20
+10 pci/ven=1002&dev=4345
+10 pci/ven=1002&dev=4386
+10 pci/ven=1002&dev=4396
+10 pci/ven=1002&dev=4373
+10 pci/ven=1022&dev=7463
+10 pci/ven=1022&dev=7808
+10 pci/ven=102f&dev=01b5
+10 pci/ven=10cf&dev=1415
+10 pci/ven=10de&dev=00e8
+10 pci/ven=10de&dev=055f
+10 pci/ven=10de&dev=056a
+10 pci/ven=10de&dev=077c
+10 pci/ven=10de&dev=077e
+10 pci/ven=10de&dev=0aa6
+10 pci/ven=10de&dev=0aa9
+10 pci/ven=10de&dev=0aaa
+10 pci/ven=10de&dev=0d9d
+10 pci/ven=1166&dev=0414
+10 pci/ven=1166&dev=0416
+10 pci/ven=1414&dev=5805
+10 pci/ven=1414&dev=5807
+10 pci/ven=15ad&dev=0770
+10 pci/ven=17a0&dev=8084
+10 pci/ven=8086&dev=24cd
+10 pci/ven=8086&dev=24dd
+10 pci/ven=8086&dev=265c
+10 pci/ven=8086&dev=268c
+10 pci/ven=8086&dev=27cc
+10 pci/ven=8086&dev=2836
+10 pci/ven=8086&dev=283a
+10 pci/ven=8086&dev=293a
+10 pci/ven=8086&dev=293c
+10 pci/ven=8086&dev=3a3a
+10 pci/ven=8086&dev=3a3c
+10 pci/ven=8086&dev=3a6a
+10 pci/ven=8086&dev=3a6c
+10 pci/ven=8086&dev=8117
+10 pci/ven=8086&dev=8807
+10 pci/ven=8086&dev=880f
Index: uspace/drv/bus/usb/ohci/ohci.ma
===================================================================
--- uspace/drv/bus/usb/ohci/ohci.ma	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/drv/bus/usb/ohci/ohci.ma	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -1,1 +1,15 @@
-10 pci/class=0c&subclass=03&progif=10
+10 pci/ven=106b&dev=0026
+10 pci/ven=106b&dev=003f
+10 pci/ven=10de&dev=0aa5
+
+10 pci/ven=1002&dev=4374
+10 pci/ven=1002&dev=4375
+
+10 pci/ven=1002&dev=4387
+10 pci/ven=1002&dev=4388
+10 pci/ven=1002&dev=4389
+10 pci/ven=1002&dev=438a
+10 pci/ven=1002&dev=438b
+10 pci/ven=1002&dev=4397
+10 pci/ven=1002&dev=4398
+10 pci/ven=1002&dev=4399
Index: uspace/drv/bus/usb/uhci/uhci.ma
===================================================================
--- uspace/drv/bus/usb/uhci/uhci.ma	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/drv/bus/usb/uhci/uhci.ma	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -1,1 +1,29 @@
-10 pci/class=0c&subclass=03&progif=00
+10 pci/ven=8086&dev=7020
+10 pci/ven=8086&dev=7112
+
+10 pci/ven=8086&dev=27c8
+10 pci/ven=8086&dev=27c9
+10 pci/ven=8086&dev=27ca
+10 pci/ven=8086&dev=27cb
+
+10 pci/ven=8086&dev=2830
+10 pci/ven=8086&dev=2831
+10 pci/ven=8086&dev=2832
+10 pci/ven=8086&dev=2834
+10 pci/ven=8086&dev=2835
+
+10 pci/ven=8086&dev=2934
+10 pci/ven=8086&dev=2935
+10 pci/ven=8086&dev=2936
+10 pci/ven=8086&dev=2937
+10 pci/ven=8086&dev=2938
+10 pci/ven=8086&dev=2939
+
+10 pci/ven=8086&dev=24c2
+10 pci/ven=8086&dev=24c4
+10 pci/ven=8086&dev=24c7
+
+10 pci/ven=8086&dev=2688
+10 pci/ven=8086&dev=2689
+10 pci/ven=8086&dev=268a
+10 pci/ven=8086&dev=268b
Index: uspace/drv/bus/usb/vhc/vhc.ma
===================================================================
--- uspace/drv/bus/usb/vhc/vhc.ma	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/drv/bus/usb/vhc/vhc.ma	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -1,1 +1,2 @@
 10 usb&hc=vhc
+
Index: uspace/drv/nic/lo/lo.ma
===================================================================
--- uspace/drv/nic/lo/lo.ma	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/drv/nic/lo/lo.ma	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
Index: uspace/drv/nic/ne2k/ne2k.ma
===================================================================
--- uspace/drv/nic/ne2k/ne2k.ma	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/drv/nic/ne2k/ne2k.ma	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
Index: uspace/lib/c/generic/ddi.c
===================================================================
--- uspace/lib/c/generic/ddi.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/lib/c/generic/ddi.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -53,24 +53,22 @@
 }
 
-/** Map a piece of physical memory to task.
+/** Map piece of physical memory to task.
  *
  * Caller of this function must have the CAP_MEM_MANAGER capability.
  *
- * @param pf    Physical address of the starting frame.
- * @param vp    Virtual address of the starting page.
- * @param pages Number of pages to map.
- * @param flags Flags for the new address space area.
+ * @param pf		Physical address of the starting frame.
+ * @param vp		Virtual address of the starting page.
+ * @param pages		Number of pages to map.
+ * @param flags		Flags for the new address space area.
  *
- * @return EOK on success
- * @return EPERM if the caller lacks the CAP_MEM_MANAGER capability
- * @return ENOENT if there is no task with specified ID
- * @return ENOMEM if there was some problem in creating
- *         the address space area.
- *
+ * @return 		0 on success, EPERM if the caller lacks the
+ *			CAP_MEM_MANAGER capability, ENOENT if there is no task
+ *			with specified ID and ENOMEM if there was some problem
+ *			in creating address space area.
  */
-int physmem_map(void *pf, void *vp, size_t pages, unsigned int flags)
+int physmem_map(void *pf, void *vp, unsigned long pages, int flags)
 {
-	return __SYSCALL4(SYS_PHYSMEM_MAP, (sysarg_t) pf, (sysarg_t) vp,
-	    pages, flags);
+	return __SYSCALL4(SYS_PHYSMEM_MAP, (sysarg_t) pf, (sysarg_t) vp, pages,
+	    flags);
 }
 
Index: uspace/lib/c/include/ddi.h
===================================================================
--- uspace/lib/c/include/ddi.h	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/lib/c/include/ddi.h	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -41,5 +41,5 @@
 
 extern int device_assign_devno(void);
-extern int physmem_map(void *, void *, size_t, unsigned int);
+extern int physmem_map(void *, void *, unsigned long, int);
 extern int iospace_enable(task_id_t, void *, unsigned long);
 extern int pio_enable(void *, size_t, void **);
Index: uspace/lib/minix/minix.h
===================================================================
--- uspace/lib/minix/minix.h	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/lib/minix/minix.h	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -39,9 +39,9 @@
 #define S_ISDIR(m)		(((m) & S_IFMT) == S_IFDIR)
 #define S_ISREG(m)		(((m) & S_IFMT) == S_IFREG)
-#define S_IFDIR			0040000		/* Directory */
-#define S_IFREG			0100000		/* Regular file */
+#define S_IFDIR			0040000		/*Directory*/
+#define S_IFREG			0100000		/*Regular file*/
 #define S_IFMT			00170000
 
-/* The following block sizes are valid only on V3 filesystem */
+/*The following block sizes are valid only on V3 filesystem*/
 #define MFS_MIN_BLOCKSIZE	1024
 #define MFS_MAX_BLOCKSIZE	4096
@@ -88,19 +88,19 @@
 #define MFS_ERROR_FS		0x0002
 
-/* MFS V1/V2 superblock data on disk */
+/*MFS V1/V2 superblock data on disk*/
 struct mfs_superblock {
-	/* Total number of inodes on the device */
+	/*Total number of inodes on the device*/
 	uint16_t	s_ninodes;
-	/* Total number of zones on the device */
+	/*Total number of zones on the device*/
 	uint16_t	s_nzones;
-	/* Number of inode bitmap blocks */
+	/*Number of inode bitmap blocks*/
 	uint16_t	s_ibmap_blocks;
-	/* Number of zone bitmap blocks */
+	/*Number of zone bitmap blocks*/
 	uint16_t	s_zbmap_blocks;
-	/* First data zone on device */
+	/*First data zone on device*/
 	uint16_t	s_first_data_zone;
-	/* Base 2 logarithm of the zone to block ratio */
+	/*Base 2 logarithm of the zone to block ratio*/
 	uint16_t	s_log2_zone_size;
-	/* Maximum file size expressed in bytes */
+	/*Maximum file size expressed in bytes*/
 	uint32_t	s_max_file_size;
 	/*
@@ -109,28 +109,28 @@
 	 */
 	uint16_t	s_magic;
-	/* Flag used to detect FS errors*/
+	/*Flag used to detect FS errors*/
 	uint16_t	s_state;
-	/* Total number of zones on the device (V2 only) */
+	/*Total number of zones on the device (V2 only)*/
 	uint32_t	s_nzones2;
 } __attribute__ ((packed));
 
 
-/* MFS V3 superblock data on disk */
+/*MFS V3 superblock data on disk*/
 struct mfs3_superblock {
-	/* Total number of inodes on the device */
+	/*Total number of inodes on the device*/
 	uint32_t	s_ninodes;
 	uint16_t	s_pad0;
-	/* Number of inode bitmap blocks */
+	/*Number of inode bitmap blocks*/
 	int16_t		s_ibmap_blocks;
-	/* Number of zone bitmap blocks */
+	/*Number of zone bitmap blocks*/
 	int16_t		s_zbmap_blocks;
-	/* First data zone on device */
+	/*First data zone on device*/
 	uint16_t	s_first_data_zone;
-	/* Base 2 logarithm of the zone to block ratio */
+	/*Base 2 logarithm of the zone to block ratio*/
 	int16_t		s_log2_zone_size;
 	int16_t		s_pad1;
-	/* Maximum file size expressed in bytes */
+	/*Maximum file size expressed in bytes*/
 	uint32_t	s_max_file_size;
-	/* Total number of zones on the device */
+	/*Total number of zones on the device*/
 	uint32_t	s_nzones;
 	/*
@@ -140,11 +140,11 @@
 	int16_t		s_magic;
 	int16_t		s_pad2;
-	/* Filesystem block size expressed in bytes */
+	/*Filesystem block size expressed in bytes*/
 	uint16_t	s_block_size;
-	/* Filesystem disk format version */
+	/*Filesystem disk format version*/
 	int8_t		s_disk_version;
 } __attribute__ ((packed));
 
-/* MinixFS V1 inode structure as it is on disk */
+/*MinixFS V1 inode structure as it is on disk*/
 struct mfs_inode {
 	uint16_t	i_mode;
@@ -154,11 +154,11 @@
 	uint8_t		i_gid;
 	uint8_t		i_nlinks;
-	/* Block numbers for direct zones */
+	/*Block numbers for direct zones*/
 	uint16_t	i_dzone[V1_NR_DIRECT_ZONES];
-	/* Block numbers for indirect zones */
+	/*Block numbers for indirect zones*/
 	uint16_t	i_izone[V1_NR_INDIRECT_ZONES];
 } __attribute__ ((packed));
 
-/* MinixFS V2 inode structure as it is on disk (also valid for V3). */
+/*MinixFS V2 inode structure as it is on disk (also valid for V3).*/
 struct mfs2_inode {
 	uint16_t 	i_mode;
@@ -170,11 +170,11 @@
 	int32_t		i_mtime;
 	int32_t		i_ctime;
-	/* Block numbers for direct zones */
+	/*Block numbers for direct zones*/
 	uint32_t	i_dzone[V2_NR_DIRECT_ZONES];
-	/* Block numbers for indirect zones */
+	/*Block numbers for indirect zones*/
 	uint32_t	i_izone[V2_NR_INDIRECT_ZONES];
 } __attribute__ ((packed));
 
-/* MinixFS V1/V2 directory entry on-disk structure */
+/*MinixFS V1/V2 directory entry on-disk structure*/
 struct mfs_dentry {
 	uint16_t d_inum;
@@ -182,5 +182,5 @@
 };
 
-/* MinixFS V3 directory entry on-disk structure */
+/*MinixFS V3 directory entry on-disk structure*/
 struct mfs3_dentry {
 	uint32_t d_inum;
Index: uspace/srv/bd/rd/rd.c
===================================================================
--- uspace/srv/bd/rd/rd.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/srv/bd/rd/rd.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -55,7 +55,6 @@
 #include <ipc/bd.h>
 #include <macros.h>
-#include <inttypes.h>
-
-#define NAME  "rd"
+
+#define NAME "rd"
 
 /** Pointer to the ramdisk's image */
@@ -209,42 +208,39 @@
 static bool rd_init(void)
 {
-	sysarg_t size;
-	int ret = sysinfo_get_value("rd.size", &size);
-	if ((ret != EOK) || (size == 0)) {
+	int ret = sysinfo_get_value("rd.size", &rd_size);
+	if ((ret != EOK) || (rd_size == 0)) {
 		printf("%s: No RAM disk found\n", NAME);
 		return false;
 	}
 	
-	sysarg_t addr_phys;
-	ret = sysinfo_get_value("rd.address.physical", &addr_phys);
-	if ((ret != EOK) || (addr_phys == 0)) {
+	sysarg_t rd_ph_addr;
+	ret = sysinfo_get_value("rd.address.physical", &rd_ph_addr);
+	if ((ret != EOK) || (rd_ph_addr == 0)) {
 		printf("%s: Invalid RAM disk physical address\n", NAME);
 		return false;
 	}
 	
-	rd_size = ALIGN_UP(size, block_size);
 	rd_addr = as_get_mappable_page(rd_size);
 	
-	unsigned int flags =
-	    AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE;
-	ret = physmem_map((void *) addr_phys, rd_addr,
+	int flags = AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE;
+	int retval = physmem_map((void *) rd_ph_addr, rd_addr,
 	    ALIGN_UP(rd_size, PAGE_SIZE) >> PAGE_WIDTH, flags);
-	if (ret < 0) {
+	
+	if (retval < 0) {
 		printf("%s: Error mapping RAM disk\n", NAME);
 		return false;
 	}
 	
-	printf("%s: Found RAM disk at %p, %" PRIun " bytes\n", NAME,
-	    (void *) addr_phys, size);
-	
-	ret = loc_server_register(NAME, rd_connection);
-	if (ret < 0) {
-		printf("%s: Unable to register driver (%d)\n", NAME, ret);
+	printf("%s: Found RAM disk at %p, %zu bytes\n", NAME,
+	    (void *) rd_ph_addr, rd_size);
+	
+	int rc = loc_server_register(NAME, rd_connection);
+	if (rc < 0) {
+		printf("%s: Unable to register driver (%d)\n", NAME, rc);
 		return false;
 	}
 	
 	service_id_t service_id;
-	ret = loc_service_register("bd/initrd", &service_id);
-	if (ret != EOK) {
+	if (loc_service_register("bd/initrd", &service_id) != EOK) {
 		printf("%s: Unable to register device service\n", NAME);
 		return false;
Index: uspace/srv/fs/mfs/mfs.h
===================================================================
--- uspace/srv/fs/mfs/mfs.h	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/srv/fs/mfs/mfs.h	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -48,5 +48,5 @@
 #define NAME		"mfs"
 
-/* #define DEBUG_MODE */
+//#define DEBUG_MODE
 
 #define min(a, b)	((a) < (b) ? (a) : (b))
@@ -71,5 +71,5 @@
 } mfs_version_t;
 
-/* Generic MinixFS superblock */
+/*Generic MinixFS superblock*/
 struct mfs_sb_info {
 	uint32_t ninodes;
@@ -84,5 +84,5 @@
 	uint16_t state;
 
-	/* The following fields do not exist on disk but only in memory */
+	/*The following fields do not exist on disk but only in memory*/
 	unsigned long itable_size;
 	mfs_version_t fs_version;
@@ -97,5 +97,5 @@
 };
 
-/* Generic MinixFS inode */
+/*Generic MinixFS inode*/
 struct mfs_ino_info {
 	uint16_t	i_mode;
@@ -107,24 +107,24 @@
 	int32_t		i_mtime;
 	int32_t		i_ctime;
-	/* Block numbers for direct zones */
+	/*Block numbers for direct zones*/
 	uint32_t	i_dzone[V2_NR_DIRECT_ZONES];
-	/* Block numbers for indirect zones */
+	/*Block numbers for indirect zones*/
 	uint32_t	i_izone[V2_NR_INDIRECT_ZONES];
 
-	/* The following fields do not exist on disk but only in memory */
+	/*The following fields do not exist on disk but only in memory*/
 	bool dirty;
 	fs_index_t index;
 };
 
-/* Generic MFS directory entry */
+/*Generic MFS directory entry*/
 struct mfs_dentry_info {
 	uint32_t d_inum;
 	char d_name[MFS3_MAX_NAME_LEN + 1];
 
-	/* The following fields do not exist on disk but only in memory */
-
-	/* Index of the dentry in the list */
+	/*The following fields do not exist on disk but only in memory*/
+
+	/*Index of the dentry in the list*/
 	unsigned index;
-	/* Pointer to the node at witch the dentry belongs */
+	/*Pointer to the node at witch the dentry belongs*/
 	struct mfs_node *node;
 };
@@ -136,5 +136,5 @@
 };
 
-/* MinixFS node in core */
+/*MinixFS node in core*/
 struct mfs_node {
 	struct mfs_ino_info *ino_i;
@@ -145,5 +145,5 @@
 };
 
-/* mfs_ops.c */
+/*mfs_ops.c*/
 extern vfs_out_ops_t mfs_ops;
 extern libfs_ops_t mfs_libfs_ops;
@@ -152,8 +152,8 @@
 mfs_global_init(void);
 
-/* mfs_inode.c */
+/*mfs_inode.c*/
 extern int
 mfs_get_inode(struct mfs_instance *inst, struct mfs_ino_info **ino_i,
-    fs_index_t index);
+	  fs_index_t index);
 
 extern int
@@ -163,5 +163,5 @@
 mfs_inode_shrink(struct mfs_node *mnode, size_t size_shrink);
 
-/* mfs_rw.c */
+/*mfs_rw.c*/
 extern int
 mfs_read_map(uint32_t *b, const struct mfs_node *mnode, const uint32_t pos);
@@ -169,13 +169,13 @@
 extern int
 mfs_write_map(struct mfs_node *mnode, uint32_t pos, uint32_t new_zone,
-    uint32_t *old_zone);
+	  uint32_t *old_zone);
 
 extern int
 mfs_prune_ind_zones(struct mfs_node *mnode, size_t new_size);
 
-/* mfs_dentry.c */
+/*mfs_dentry.c*/
 extern int
 mfs_read_dentry(struct mfs_node *mnode,
-    struct mfs_dentry_info *d_info, unsigned index);
+		     struct mfs_dentry_info *d_info, unsigned index);
 
 extern int
@@ -188,5 +188,5 @@
 mfs_insert_dentry(struct mfs_node *mnode, const char *d_name, fs_index_t d_inum);
 
-/* mfs_balloc.c */
+/*mfs_balloc.c*/
 extern int
 mfs_alloc_inode(struct mfs_instance *inst, uint32_t *inum);
@@ -201,5 +201,5 @@
 mfs_free_zone(struct mfs_instance *inst, uint32_t zone);
 
-/* mfs_utils.c */
+/*mfs_utils.c*/
 extern uint16_t
 conv16(bool native, uint16_t n);
Index: uspace/srv/fs/mfs/mfs_balloc.c
===================================================================
--- uspace/srv/fs/mfs/mfs_balloc.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/srv/fs/mfs/mfs_balloc.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -198,5 +198,5 @@
 		limit = sbi->nzones - sbi->firstdatazone - 1;
 	} else {
-		/* bid == BMAP_INODE */
+		/*bid == BMAP_INODE*/
 		search = &sbi->isearch;
 		start_block = 2;
@@ -212,5 +212,5 @@
 	for (i = *search / bits_per_block; i < nblocks; ++i) {
 		r = block_get(&b, inst->service_id, i + start_block,
-		    BLOCK_FLAGS_NONE);
+			      BLOCK_FLAGS_NONE);
 
 		if (r != EOK)
Index: uspace/srv/fs/mfs/mfs_dentry.c
===================================================================
--- uspace/srv/fs/mfs/mfs_dentry.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/srv/fs/mfs/mfs_dentry.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -168,5 +168,5 @@
 		return ENAMETOOLONG;
 
-	/* Search the directory entry to be removed */
+	/*Search the directory entry to be removed*/
 	unsigned i;
 	for (i = 0; i < mnode->ino_i->i_size / sbi->dirsize ; ++i) {
Index: uspace/srv/fs/mfs/mfs_inode.c
===================================================================
--- uspace/srv/fs/mfs/mfs_inode.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/srv/fs/mfs/mfs_inode.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -235,6 +235,6 @@
 
 	r = block_get(&b, mnode->instance->service_id,
-	    itable_off + inum / sbi->ino_per_block,
-	    BLOCK_FLAGS_NONE);
+		      itable_off + inum / sbi->ino_per_block,
+		      BLOCK_FLAGS_NONE);
 
 	if (r != EOK)
@@ -278,6 +278,6 @@
 
 	r = block_get(&b, mnode->instance->service_id,
-	    itable_off + inum / sbi->ino_per_block,
-	    BLOCK_FLAGS_NONE);
+		      itable_off + inum / sbi->ino_per_block,
+		      BLOCK_FLAGS_NONE);
 
 	if (r != EOK)
Index: uspace/srv/fs/mfs/mfs_ops.c
===================================================================
--- uspace/srv/fs/mfs/mfs_ops.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/srv/fs/mfs/mfs_ops.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -664,5 +664,4 @@
 	struct mfs_node *child = cfn->data;
 	struct mfs_sb_info *sbi = parent->instance->sbi;
-	bool destroy_dentry = false;
 
 	mfsdebug("%s()\n", __FUNCTION__);
@@ -673,24 +672,17 @@
 	int r = mfs_insert_dentry(parent, name, child->ino_i->index);
 	if (r != EOK)
-		return r;
+		goto exit_error;
+
+	child->ino_i->i_nlinks++;
+	child->ino_i->dirty = true;
 
 	if (S_ISDIR(child->ino_i->i_mode)) {
-		if (child->ino_i->i_nlinks != 1) {
-			/* It's not possible to hardlink directories in MFS */
-			destroy_dentry = true;
-			r = EMLINK;
-			goto exit;
-		}
 		r = mfs_insert_dentry(child, ".", child->ino_i->index);
-		if (r != EOK) {
-			destroy_dentry = true;
-			goto exit;
-		}
+		if (r != EOK)
+			goto exit_error;
 
 		r = mfs_insert_dentry(child, "..", parent->ino_i->index);
-		if (r != EOK) {
-			destroy_dentry = true;
-			goto exit;
-		}
+		if (r != EOK)
+			goto exit_error;
 
 		parent->ino_i->i_nlinks++;
@@ -698,13 +690,5 @@
 	}
 
-exit:
-	if (destroy_dentry) {
-		int r2 = mfs_remove_dentry(parent, name);
-		if (r2 != EOK)
-			r = r2;
-	} else {
-		child->ino_i->i_nlinks++;
-		child->ino_i->dirty = true;
-	}
+exit_error:
 	return r;
 }
@@ -837,5 +821,5 @@
 found:
 		async_data_read_finalize(callid, d_info.d_name,
-		    str_size(d_info.d_name) + 1);
+					 str_size(d_info.d_name) + 1);
 		bytes = ((pos - spos) + 1);
 	} else {
Index: uspace/srv/fs/mfs/mfs_rw.c
===================================================================
--- uspace/srv/fs/mfs/mfs_rw.c	(revision db8a034e8369ef62950d379332e1cee26f14027e)
+++ uspace/srv/fs/mfs/mfs_rw.c	(revision 04aaed8fb5f0d84ef06af90fda9391a41bdae192)
@@ -147,5 +147,5 @@
 				ino_i->dirty = true;
 			} else {
-				/* Sparse block */
+				/*Sparse block*/
 				*b = 0;
 				return EOK;
@@ -233,5 +233,5 @@
 }
 
-/**Free unused indirect zones from a MINIX inode according to its new size.
+/**Free unused indirect zones from a MINIX inode according to it's new size.
  *
  * @param mnode		Pointer to a generic MINIX inode in memory.
