Index: uspace/app/mkminix/mkminix.c
===================================================================
--- uspace/app/mkminix/mkminix.c	(revision 3c616f6e06becaacefff6613135941d88cfe4b9b)
+++ uspace/app/mkminix/mkminix.c	(revision fd282adc832e0495451af721af8ad2194ac447ca)
@@ -48,4 +48,5 @@
 #include <getopt.h>
 #include <mem.h>
+#include <str.h>
 #include <minix.h>
 
@@ -56,4 +57,5 @@
 
 #define UPPER(n, size) (((n) / (size)) + (((n) % (size)) != 0))
+#define NEXT_DENTRY(p, dirsize)	(p += dirsize)
 
 typedef enum {
@@ -75,4 +77,5 @@
 	int log2_zone_size;
 	int ino_per_block;
+	int dirsize;
 	uint32_t max_file_size;
 	uint16_t magic;
@@ -92,4 +95,5 @@
 static void	make_root_ino3(struct mfs_sb_info *sb);
 static void	mark_bmap(uint32_t *bmap, int idx, int v);
+static void	insert_dentries(struct mfs_sb_info *sb);
 
 static struct option const long_options[] = {
@@ -137,4 +141,5 @@
 			sb.fs_version = 1;
 			sb.ino_per_block = V1_INODES_PER_BLOCK;
+			sb.dirsize = MFS_DIRSIZE;
 			break;
 		case '2':
@@ -143,4 +148,5 @@
 			sb.fs_version = 2;
 			sb.ino_per_block = V2_INODES_PER_BLOCK;
+			sb.dirsize = MFS_DIRSIZE;
 			break;
 		case '3':
@@ -148,4 +154,5 @@
 			sb.fs_version = 3;
 			sb.block_size = MFS_MAX_BLOCKSIZE;
+			sb.dirsize = MFS3_DIRSIZE;
 			break;
 		case 'b':
@@ -157,4 +164,5 @@
 		case 'l':
 			sb.longnames = true;
+			sb.dirsize = MFSL_DIRSIZE;
 			break;
 		}
@@ -232,5 +240,44 @@
 	init_inode_table(&sb);
 
+	/*Insert directory entries . and ..*/
+	insert_dentries(&sb);
+
 	return 0;
+}
+
+static void insert_dentries(struct mfs_sb_info *sb)
+{
+	void *root_block;
+	const long root_dblock = sb->first_data_zone * (sb->block_size / MFS_MIN_BLOCKSIZE);
+
+	root_block = (void *) malloc(MFS_MIN_BLOCKSIZE);
+	
+	if (sb->fs_version != 3) {
+		/*Directories entry for V1/V2 filesystem*/
+		struct mfs_dentry *dentry = root_block;
+
+		dentry->d_inum = MFS_ROOT_INO;
+		str_cpy(dentry->d_name, 1, ".");
+
+		NEXT_DENTRY(dentry, sb->dirsize);
+
+		dentry->d_inum = MFS_ROOT_INO;
+		str_cpy(dentry->d_name, 2, "..");
+	} else {
+		/*Directories entry for V1/V2 filesystem*/
+		struct mfs3_dentry *dentry = root_block;
+
+		dentry->d_inum = MFS_ROOT_INO;
+		str_cpy(dentry->d_name, 1, ".");
+
+		NEXT_DENTRY(dentry, sb->dirsize);
+
+		dentry->d_inum = MFS_ROOT_INO;
+		str_cpy(dentry->d_name, 2, "..");
+	}
+
+	block_write_direct(sb->handle, root_dblock, 1, root_block);
+
+	free(root_block);
 }
 
