summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/mount.c
diff options
context:
space:
mode:
authordzwdz2022-05-05 21:01:25 +0200
committerdzwdz2022-05-05 21:01:25 +0200
commitdc42353f53df0b5425377330f16e668829d8fd9a (patch)
tree7d2af922417df9e0a708007e17bcce1ef2833b99 /src/kernel/vfs/mount.c
parent3beaeaadf36de4e494d0b40ad31e3c5c503c596e (diff)
kernel: ps2 driver is now a separate backend
Diffstat (limited to 'src/kernel/vfs/mount.c')
-rw-r--r--src/kernel/vfs/mount.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/kernel/vfs/mount.c b/src/kernel/vfs/mount.c
index a6c5970..232e702 100644
--- a/src/kernel/vfs/mount.c
+++ b/src/kernel/vfs/mount.c
@@ -4,6 +4,8 @@
#include <kernel/vfs/root.h>
#include <shared/mem.h>
+#include <kernel/arch/i386/driver/ps2.h>
+
struct vfs_mount *vfs_mount_seed(void) {
struct vfs_mount *mount = kmalloc(sizeof *mount);
struct vfs_backend *backend = kmalloc(sizeof *backend);
@@ -19,7 +21,25 @@ struct vfs_mount *vfs_mount_seed(void) {
.backend = backend,
.refs = 1, // never to be freed
};
- return mount;
+
+ // what a mess.
+ // TODO register funcs
+ struct vfs_mount *ps2 = kmalloc(sizeof *ps2);
+ backend = kmalloc(sizeof *backend);
+ backend->is_user = false;
+ backend->potential_handlers = 1;
+ backend->refcount = 1;
+ backend->kern.ready = vfs_ps2_ready;
+ backend->kern.accept = vfs_ps2_accept;
+ *ps2 = (struct vfs_mount){
+ .prev = mount,
+ .prefix = "/ps2",
+ .prefix_len = 4,
+ .backend = backend,
+ .refs = 1,
+ };
+
+ return ps2;
}
struct vfs_mount *vfs_mount_resolve(