Index: uspace/drv/block/ahci/ahci.c
===================================================================
--- uspace/drv/block/ahci/ahci.c	(revision 0f5c4e40438b2f925c877ec2fb5a3ab065007e29)
+++ uspace/drv/block/ahci/ahci.c	(revision 2e9f28483e3e3832adf6f08bb34a173e2fbf6a40)
@@ -33,4 +33,5 @@
 
 #include <as.h>
+#include <bd_srv.h>
 #include <errno.h>
 #include <stdio.h>
@@ -40,5 +41,4 @@
 #include <device/hw_res_parsed.h>
 #include <pci_dev_iface.h>
-#include <ahci_iface.h>
 #include "ahci.h"
 #include "ahci_hw.h"
@@ -110,9 +110,6 @@
 	}
 
-static errno_t get_sata_device_name(ddf_fun_t *, size_t, char *);
-static errno_t get_num_blocks(ddf_fun_t *, uint64_t *);
-static errno_t get_block_size(ddf_fun_t *, size_t *);
-static errno_t read_blocks(ddf_fun_t *, uint64_t, size_t, void *);
-static errno_t write_blocks(ddf_fun_t *, uint64_t, size_t, void *);
+static errno_t ahci_read_blocks(sata_dev_t *, uint64_t, size_t, void *);
+static errno_t ahci_write_blocks(sata_dev_t *, uint64_t, size_t, void *);
 
 static errno_t ahci_identify_device(sata_dev_t *);
@@ -132,18 +129,20 @@
 static int sata_devices_count = 0;
 
-/*
- * AHCI Interface
- */
-
-static ahci_iface_t ahci_interface = {
-	.get_sata_device_name = &get_sata_device_name,
-	.get_num_blocks = &get_num_blocks,
-	.get_block_size = &get_block_size,
-	.read_blocks = &read_blocks,
-	.write_blocks = &write_blocks
-};
-
-static ddf_dev_ops_t ahci_ops = {
-	.interfaces[AHCI_DEV_IFACE] = &ahci_interface
+static errno_t ahci_bd_open(bd_srvs_t *, bd_srv_t *);
+static errno_t ahci_bd_close(bd_srv_t *);
+static errno_t ahci_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
+static errno_t ahci_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t);
+static errno_t ahci_bd_get_block_size(bd_srv_t *, size_t *);
+static errno_t ahci_bd_get_num_blocks(bd_srv_t *, aoff64_t *);
+
+static void ahci_bd_connection(ipc_call_t *, void *);
+
+static bd_ops_t ahci_bd_ops = {
+	.open = ahci_bd_open,
+	.close = ahci_bd_close,
+	.read_blocks = ahci_bd_read_blocks,
+	.write_blocks = ahci_bd_write_blocks,
+	.get_block_size = ahci_bd_get_block_size,
+	.get_num_blocks = ahci_bd_get_num_blocks
 };
 
@@ -157,72 +156,23 @@
 };
 
-/** Get SATA structure from DDF function. */
-static sata_dev_t *fun_sata_dev(ddf_fun_t *fun)
-{
-	return ddf_fun_data_get(fun);
-}
-
-/** Get SATA device name.
- *
- * @param fun                  Device function handling the call.
- * @param sata_dev_name_length Length of the sata_dev_name buffer.
- * @param sata_dev_name        Buffer for SATA device name.
- *
- * @return EOK.
- *
- */
-static errno_t get_sata_device_name(ddf_fun_t *fun,
-    size_t sata_dev_name_length, char *sata_dev_name)
-{
-	sata_dev_t *sata = fun_sata_dev(fun);
-	str_cpy(sata_dev_name, sata_dev_name_length, sata->model);
-	return EOK;
-}
-
-/** Get Number of blocks in SATA device.
- *
- * @param fun    Device function handling the call.
- * @param blocks Return number of blocks in SATA device.
- *
- * @return EOK.
- *
- */
-static errno_t get_num_blocks(ddf_fun_t *fun, uint64_t *num_blocks)
-{
-	sata_dev_t *sata = fun_sata_dev(fun);
-	*num_blocks = sata->blocks;
-	return EOK;
-}
-
-/** Get SATA device block size.
- *
- * @param fun        Device function handling the call.
- * @param block_size Return block size.
- *
- * @return EOK.
- *
- */
-static errno_t get_block_size(ddf_fun_t *fun, size_t *block_size)
-{
-	sata_dev_t *sata = fun_sata_dev(fun);
-	*block_size = sata->block_size;
-	return EOK;
-}
-
-/** Read data blocks into SATA device.
- *
- * @param fun      Device function handling the call.
+/** Get SATA structure from block device service structure. */
+static sata_dev_t *bd_srv_sata(bd_srv_t *bd)
+{
+	return (sata_dev_t *) bd->srvs->sarg;
+}
+
+/** Read data blocks from SATA device.
+ *
+ * @param sata     SATA device
  * @param blocknum Number of first block.
  * @param count    Number of blocks to read.
  * @param buf      Buffer for data.
  *
- * @return EOK if succeed, error code otherwise
- *
- */
-static errno_t read_blocks(ddf_fun_t *fun, uint64_t blocknum,
+ * @return EOK on success, error code otherwise
+ *
+ */
+static errno_t ahci_read_blocks(sata_dev_t *sata, uint64_t blocknum,
     size_t count, void *buf)
 {
-	sata_dev_t *sata = fun_sata_dev(fun);
-
 	uintptr_t phys;
 	void *ibuf = AS_AREA_ANY;
@@ -253,19 +203,16 @@
 }
 
-/** Write data blocks into SATA device.
- *
- * @param fun      Device function handling the call.
+/** Write data blocks to SATA device.
+ *
+ * @param sata     SATA device
  * @param blocknum Number of first block.
  * @param count    Number of blocks to write.
  * @param buf      Buffer with data.
  *
- * @return EOK if succeed, error code otherwise
- *
- */
-static errno_t write_blocks(ddf_fun_t *fun, uint64_t blocknum,
+ * @return EOK on success, error code otherwise
+ */
+static errno_t ahci_write_blocks(sata_dev_t *sata, uint64_t blocknum,
     size_t count, void *buf)
 {
-	sata_dev_t *sata = fun_sata_dev(fun);
-
 	uintptr_t phys;
 	void *ibuf = AS_AREA_ANY;
@@ -291,4 +238,66 @@
 
 	return rc;
+}
+
+/** Open device. */
+static errno_t ahci_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
+{
+	return EOK;
+}
+
+/** Close device. */
+static errno_t ahci_bd_close(bd_srv_t *bd)
+{
+	return EOK;
+}
+
+/** Read blocks from partition. */
+static errno_t ahci_bd_read_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt,
+    void *buf, size_t size)
+{
+	sata_dev_t *sata = bd_srv_sata(bd);
+
+	if (size < cnt * sata->block_size)
+		return EINVAL;
+
+	return ahci_read_blocks(sata, ba, cnt, buf);
+}
+
+/** Write blocks to partition. */
+static errno_t ahci_bd_write_blocks(bd_srv_t *bd, aoff64_t ba, size_t cnt,
+    const void *buf, size_t size)
+{
+	sata_dev_t *sata = bd_srv_sata(bd);
+
+	if (size < cnt * sata->block_size)
+		return EINVAL;
+
+	return ahci_write_blocks(sata, ba, cnt, (void *)buf);
+}
+
+/** Get device block size. */
+static errno_t ahci_bd_get_block_size(bd_srv_t *bd, size_t *rsize)
+{
+	sata_dev_t *sata = bd_srv_sata(bd);
+
+	*rsize = sata->block_size;
+	return EOK;
+}
+
+/** Get number of blocks on device. */
+static errno_t ahci_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)
+{
+	sata_dev_t *sata = bd_srv_sata(bd);
+
+	*rnb = sata->blocks;
+	return EOK;
+}
+
+static void ahci_bd_connection(ipc_call_t *icall, void *arg)
+{
+	sata_dev_t *sata;
+
+	sata = (sata_dev_t *) ddf_fun_data_get((ddf_fun_t *)arg);
+	bd_conn(icall, &sata->bds);
 }
 
@@ -416,5 +425,5 @@
  * @param sata SATA device structure.
  *
- * @return EOK if succeed, error code otherwise.
+ * @return EOK on success, error code otherwise.
  *
  */
@@ -597,5 +606,5 @@
  * @param sata SATA device structure.
  *
- * @return EOK if succeed, error code otherwise
+ * @return EOK on success, error code otherwise
  *
  */
@@ -726,5 +735,5 @@
  * @param blocknum Block number to read.
  *
- * @return EOK if succeed, error code otherwise
+ * @return EOK on success, error code otherwise
  *
  */
@@ -755,5 +764,5 @@
  * @param blocknum Block number to write.
  *
- * @return EOK if succeed, error code otherwise
+ * @return EOK on success, error code otherwise
  *
  */
@@ -814,5 +823,5 @@
  * @param blocknum Block number to write.
  *
- * @return EOK if succeed, error code otherwise
+ * @return EOK on success, error code otherwise
  *
  */
@@ -921,5 +930,5 @@
  * @param port AHCI port structure
  *
- * @return SATA device structure if succeed, NULL otherwise.
+ * @return SATA device structure on success, NULL otherwise.
  *
  */
@@ -1029,5 +1038,5 @@
  * @param port_num Number of AHCI port with existing SATA device.
  *
- * @return EOK if succeed, error code otherwise.
+ * @return EOK on success, error code otherwise.
  *
  */
@@ -1036,4 +1045,5 @@
 {
 	ddf_fun_t *fun = NULL;
+	bool bound = false;
 	errno_t rc;
 
@@ -1077,5 +1087,15 @@
 
 	fun = sata->fun;
-	ddf_fun_set_ops(fun, &ahci_ops);
+
+	bd_srvs_init(&sata->bds);
+	sata->bds.ops = &ahci_bd_ops;
+	sata->bds.sarg = (void *)sata;
+
+	/* Set up a connection handler. */
+	ddf_fun_set_conn_handler(fun, ahci_bd_connection);
+
+	ddf_msg(LVL_NOTE, "Device %s - %s, blocks: %" PRIu64
+	    " block_size: %zu\n", sata_dev_name, sata->model, sata->blocks,
+	    sata->block_size);
 
 	rc = ddf_fun_bind(fun);
@@ -1085,7 +1105,18 @@
 	}
 
+	bound = true;
+
+	rc = ddf_fun_add_to_category(fun, "disk");
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Failed adding function %s to category "
+		    "'disk'.", sata_dev_name);
+		goto error;
+	}
+
 	return EOK;
 
 error:
+	if (bound)
+		ddf_fun_unbind(fun);
 	sata->is_invalid_device = true;
 	if (fun != NULL)
@@ -1124,5 +1155,5 @@
  * @param dev DDF device structure.
  *
- * @return AHCI device structure if succeed, NULL otherwise.
+ * @return AHCI device structure on success, NULL otherwise.
  *
  */
@@ -1248,5 +1279,5 @@
  * @param dev DDF device structure.
  *
- * @return EOK if succeed, error code otherwise.
+ * @return EOK on success, error code otherwise.
  *
  */
Index: uspace/drv/block/ahci/ahci.h
===================================================================
--- uspace/drv/block/ahci/ahci.h	(revision 0f5c4e40438b2f925c877ec2fb5a3ab065007e29)
+++ uspace/drv/block/ahci/ahci.h	(revision 2e9f28483e3e3832adf6f08bb34a173e2fbf6a40)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2012 Petr Jerman
  * All rights reserved.
@@ -31,8 +32,9 @@
  */
 
-#ifndef __AHCI_H__
-#define __AHCI_H__
+#ifndef AHCI_H
+#define AHCI_H
 
 #include <async.h>
+#include <bd_srv.h>
 #include <ddf/interrupt.h>
 #include <stdio.h>
@@ -105,4 +107,7 @@
 	/** Highest UDMA mode supported. */
 	uint8_t highest_udma_mode;
+
+	/** Block device service structure */
+	bd_srvs_t bds;
 } sata_dev_t;
 
Index: uspace/drv/block/ahci/ahci_hw.h
===================================================================
--- uspace/drv/block/ahci/ahci_hw.h	(revision 0f5c4e40438b2f925c877ec2fb5a3ab065007e29)
+++ uspace/drv/block/ahci/ahci_hw.h	(revision 2e9f28483e3e3832adf6f08bb34a173e2fbf6a40)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2012 Petr Jerman
  * All rights reserved.
@@ -31,6 +32,6 @@
  */
 
-#ifndef __AHCI_HW_H__
-#define __AHCI_HW_H__
+#ifndef AHCI_HW_H
+#define AHCI_HW_H
 
 #include <stdint.h>
Index: uspace/drv/block/ahci/ahci_sata.h
===================================================================
--- uspace/drv/block/ahci/ahci_sata.h	(revision 0f5c4e40438b2f925c877ec2fb5a3ab065007e29)
+++ uspace/drv/block/ahci/ahci_sata.h	(revision 2e9f28483e3e3832adf6f08bb34a173e2fbf6a40)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2012 Petr Jerman
  * All rights reserved.
@@ -31,6 +32,6 @@
  */
 
-#ifndef __AHCI_SATA_H__
-#define __AHCI_SATA_H__
+#ifndef AHCI_SATA_H
+#define AHCI_SATA_H
 
 #include <stdint.h>
