dev: Implement basic devctl

This commit is contained in:
2026-10-25 19:48:03 +01:00
parent eb86ea3622
commit 95d2096dda
5 changed files with 285 additions and 5 deletions
+6 -2
View File
@@ -5,6 +5,7 @@
#include <zinnia/alloc.h>
#include <zinnia/blockdev.h>
#include <zinnia/chardev.h>
#include <zinnia/devctl.h>
#include <zinnia/initgraph.h>
#include <zinnia/print.h>
#include <zinnia/tailq.h>
@@ -297,9 +298,12 @@ errno_t devtmpfs_add_blockdev(const char* name, struct blockdev* dev, mode_t mod
struct vfs_path root = devtmpfs_root();
errno_t status = vfs_mknod(root, root, name, mode, &target, ident_kernel(), nullptr);
vfs_path_drop(root);
if (status)
if (status) {
blockdev_unref(dev);
return status;
return status;
}
devctl_notify_create(name);
return 0;
}
errno_t blockdev_from_node(struct vfs_node* node, struct blockdev** out) {