From dc6e642e0f77fd793315d5a3a8d65498efd4450d Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 13 May 2025 20:54:22 -0400 Subject: kernel: fs: Introduce ctlfs ctlfs (Control FS) is a filesystem aimed to provide configuration of devices separate from their respective devices files. Most UNIX-like systems rely on the ioctl() mechanism for sending commands to device drivers, while this certainly works, it is important to realize how messy it can get doing all of this through a single interface. ctlfs fixes this by giving each device a "node" in ctlfs that contains several control files. For example, imagine we have a SCSI device (/dev/sd1). Its ctlfs counterpart would be a directory at /ctl/sd1/. For an hdd this may contain files such as: /ctl/sd1/bsize # Block size if read (mode [rwx]: -w-) /ctl/sd1/cmd # Command if written, status if read (mode [rwx]: rw-) ... et cetera Signed-off-by: Ian Moffett --- sys/kern/vfs_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/kern') diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index caa0766..8c1bc74 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -36,7 +36,8 @@ struct vnode *g_root_vnode = NULL; static struct fs_info fs_list[] = { {MOUNT_RAMFS, &g_initramfs_vfsops, 0, 0}, - {MOUNT_DEVFS, &g_devfs_vfsops, 0, 0} + {MOUNT_DEVFS, &g_devfs_vfsops, 0, 0}, + {MOUNT_CTLFS, &g_ctlfs_vfsops, 0, 0} }; void -- cgit v1.2.3