summaryrefslogtreecommitdiff
path: root/sys/kern/disk_engine.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-08-18 03:06:14 +0000
committerIan Moffett <ian@osmora.org>2025-08-18 03:06:14 +0000
commit8a64c7d6a3ff2cc0cf87ba47cbbe1c4fe3aa170e (patch)
treea17153a95e28179329d13b342b7219e5b42299a9 /sys/kern/disk_engine.c
parent50013e9da3036dbd8f36a2e1a8bfdc81d707d11f (diff)
kernel: disk: Add DISK_IO_QUERY op to disk engine
This commit introduces the DISK_IO_QUERY opcode to the disk engine so that a user application may query specific devices. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/disk_engine.c')
-rw-r--r--sys/kern/disk_engine.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/kern/disk_engine.c b/sys/kern/disk_engine.c
index a49c15f..1061165 100644
--- a/sys/kern/disk_engine.c
+++ b/sys/kern/disk_engine.c
@@ -172,6 +172,18 @@ disk_mux_io(diskid_t id, diskop_t opcode, struct disk_param *u_param)
param.size
);
break;
+ case DISK_IO_QUERY:
+ retval = disk_query(
+ id,
+ param.buf
+ );
+
+ /* Write back info to user program */
+ error = copyout(param.buf, param.u_buf, param.size);
+ if (error < 0) {
+ retval = error;
+ }
+ break;
}
disk_param_free(&param);