Index: uspace/app/bdsh/cmds/modules/bdd/bdd.c
===================================================================
--- uspace/app/bdsh/cmds/modules/bdd/bdd.c	(revision cffce579c933420dcfd2735ce15d6f4d70c5fb40)
+++ uspace/app/bdsh/cmds/modules/bdd/bdd.c	(revision b53e6d988231fc712f38c910569722a32a43a34a)
@@ -42,6 +42,8 @@
 #include <assert.h>
 
-#define BLOCK_SIZE	512
-#define BPR		 16
+enum {
+	/* Number of bytes per row */
+	BPR = 16
+};
 
 static const char *cmdname = "bdd";
@@ -67,9 +69,9 @@
 	unsigned int i, j;
 	dev_handle_t handle;
-	block_t *block;
 	uint8_t *blk;
 	size_t size, bytes, rows;
+	size_t block_size;
 	int rc;
-	bn_t boff;
+	bn_t ba;
 	uint8_t b;
 
@@ -83,7 +85,7 @@
 
 	if (argc >= 3)
-		boff = strtol(argv[2], NULL, 0);
+		ba = strtol(argv[2], NULL, 0);
 	else
-		boff = 0;
+		ba = 0;
 
 	if (argc >= 4)
@@ -94,30 +96,37 @@
 	rc = devmap_device_get_handle(argv[1], &handle, 0);
 	if (rc != EOK) {
-		printf("Error: could not resolve device `%s'.\n", argv[1]);
+		printf("%s: Error resolving device `%s'.\n", cmdname, argv[1]);
 		return CMD_FAILURE;
 	}
 
-	rc = block_init(handle, BLOCK_SIZE);
+	rc = block_init(handle, 2048);
 	if (rc != EOK)  {
-		printf("Error: could not init libblock.\n");
+		printf("%s: Error initializing libblock.\n", cmdname);
 		return CMD_FAILURE;
 	}
 
-	rc = block_cache_init(handle, BLOCK_SIZE, 2, CACHE_MODE_WB);
+	rc = block_get_bsize(handle, &block_size);
 	if (rc != EOK) {
-		printf("Error: could not init block cache.\n");
+		printf("%s: Error determining device block size.\n", cmdname);
+		return CMD_FAILURE;
+	}
+
+	blk = malloc(block_size);
+	if (blk == NULL) {
+		printf("%s: Error allocating memory.\n", cmdname);
+		block_fini(handle);
 		return CMD_FAILURE;
 	}
 
 	while (size > 0) {
-		rc = block_get(&block, handle, boff, 0);
+		rc = block_read_direct(handle, ba, 1, blk);
 		if (rc != EOK) {
-			printf("Error: could not get block %u, device %u.\n",
-			    boff, handle);
+			printf("%s: Error reading block %llu\n", cmdname, ba);
+			free(blk);
+			block_fini(handle);
 			return CMD_FAILURE;
 		}
-		blk = (uint8_t *) block->data;
 
-		bytes = (size < BLOCK_SIZE) ? size : BLOCK_SIZE;
+		bytes = (size < block_size) ? size : block_size;
 		rows = (bytes + BPR - 1) / BPR;
 
@@ -145,11 +154,4 @@
 		}
 
-		rc = block_put(block);
-		if (rc != EOK) {
-			printf("Error: could not put block %p.\n",
-			    block);
-			return CMD_FAILURE;
-		}
-
 		if (size > rows * BPR)
 			size -= rows * BPR;
@@ -157,7 +159,9 @@
 			size = 0;
 
-		boff += rows * BPR;
+		/* Next block */
+		ba += 1;
 	}
 
+	free(blk);
 	block_fini(handle);
 
