summaryrefslogtreecommitdiff
path: root/src/kernel/vfs
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/vfs')
-rw-r--r--src/kernel/vfs/mount.c22
-rw-r--r--src/kernel/vfs/request.h1
-rw-r--r--src/kernel/vfs/root.c9
3 files changed, 22 insertions, 10 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(
diff --git a/src/kernel/vfs/request.h b/src/kernel/vfs/request.h
index e62f28f..b4624fa 100644
--- a/src/kernel/vfs/request.h
+++ b/src/kernel/vfs/request.h
@@ -1,4 +1,5 @@
#pragma once
+#include <kernel/proc.h>
#include <shared/flags.h>
#include <shared/types.h>
#include <stdbool.h>
diff --git a/src/kernel/vfs/root.c b/src/kernel/vfs/root.c
index 701d4e6..0c58d86 100644
--- a/src/kernel/vfs/root.c
+++ b/src/kernel/vfs/root.c
@@ -15,7 +15,6 @@ enum {
HANDLE_ROOT,
HANDLE_VGA,
HANDLE_COM1,
- HANDLE_PS2,
HANDLE_ATA_ROOT,
HANDLE_ATA,
_SKIP = HANDLE_ATA + 4,
@@ -72,7 +71,6 @@ static int handle(struct vfs_request *req, bool *ready) {
if (exacteq(req, "/")) return HANDLE_ROOT;
if (exacteq(req, "/vga")) return HANDLE_VGA;
if (exacteq(req, "/com1")) return HANDLE_COM1;
- if (exacteq(req, "/ps2")) return HANDLE_PS2;
if (exacteq(req, "/ata/")) return HANDLE_ATA_ROOT;
if (exacteq(req, "/ata/0"))
@@ -113,13 +111,6 @@ static int handle(struct vfs_request *req, bool *ready) {
virt_cpy_to(req->caller->pages, req->output.buf, buf, len);
return len;
}
- case HANDLE_PS2: {
- if (wait_setup(req, ready, ps2_ready)) return -1;
- uint8_t buf[16];
- size_t len = ps2_read(buf, min(req->output.len, sizeof buf));
- virt_cpy_to(req->caller->pages, req->output.buf, buf, len);
- return len;
- }
case HANDLE_ATA_ROOT: {
// TODO offset
char list[8] = {};