summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
authordzwdz2022-05-05 22:50:49 +0200
committerdzwdz2022-05-05 22:50:49 +0200
commit40f4fb7c9879c678fa82906116fefdaed63aaed6 (patch)
tree4dba91962741973999695dfec522dea972932024 /src/kernel
parenta40063321e8fbf4d82f46471221062bfa393604a (diff)
kernel: move fsroot to kernel/arch/i386
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/arch/i386/boot.c2
-rw-r--r--src/kernel/arch/i386/driver/fsroot.c (renamed from src/kernel/vfs/root.c)12
-rw-r--r--src/kernel/arch/i386/driver/fsroot.h (renamed from src/kernel/vfs/root.h)0
-rw-r--r--src/kernel/vfs/request.c2
4 files changed, 5 insertions, 11 deletions
diff --git a/src/kernel/arch/i386/boot.c b/src/kernel/arch/i386/boot.c
index be80f73..4969c1c 100644
--- a/src/kernel/arch/i386/boot.c
+++ b/src/kernel/arch/i386/boot.c
@@ -1,6 +1,7 @@
#include <kernel/arch/generic.h>
#include <kernel/arch/i386/ata.h>
#include <kernel/arch/i386/boot.h>
+#include <kernel/arch/i386/driver/fsroot.h>
#include <kernel/arch/i386/driver/ps2.h>
#include <kernel/arch/i386/driver/serial.h>
#include <kernel/arch/i386/gdt.h>
@@ -10,7 +11,6 @@
#include <kernel/main.h>
#include <kernel/mem/alloc.h>
#include <kernel/panic.h>
-#include <kernel/vfs/root.h>
void tty_init(void); // TODO put this in a header file
diff --git a/src/kernel/vfs/root.c b/src/kernel/arch/i386/driver/fsroot.c
index 8ba2043..49cecc9 100644
--- a/src/kernel/vfs/root.c
+++ b/src/kernel/arch/i386/driver/fsroot.c
@@ -3,12 +3,10 @@
#include <kernel/panic.h>
#include <kernel/proc.h>
#include <kernel/util.h>
-#include <kernel/vfs/root.h>
+#include <kernel/arch/i386/driver/fsroot.h>
#include <shared/mem.h>
#include <stdbool.h>
-// TODO move to arch/
-
enum {
HANDLE_ROOT,
HANDLE_VGA,
@@ -45,7 +43,7 @@ static void req_preprocess(struct vfs_request *req, size_t max_len) {
}
-static int handle(struct vfs_request *req, bool *ready) {
+static int handle(struct vfs_request *req) {
assert(req->caller);
switch (req->type) {
case VFSOP_OPEN:
@@ -132,11 +130,7 @@ static int handle(struct vfs_request *req, bool *ready) {
static void accept(struct vfs_request *req) {
if (req->caller) {
- bool ready = true;
- int ret = handle(req, &ready);
- if (ready) {
- vfsreq_finish(req, ret);
- }
+ vfsreq_finish(req, handle(req));
} else {
vfsreq_finish(req, -1);
}
diff --git a/src/kernel/vfs/root.h b/src/kernel/arch/i386/driver/fsroot.h
index dd72202..dd72202 100644
--- a/src/kernel/vfs/root.h
+++ b/src/kernel/arch/i386/driver/fsroot.h
diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c
index 0c3084d..516e6e0 100644
--- a/src/kernel/vfs/request.c
+++ b/src/kernel/vfs/request.c
@@ -1,9 +1,9 @@
+#include <kernel/arch/i386/driver/fsroot.h>
#include <kernel/mem/alloc.h>
#include <kernel/mem/virt.h>
#include <kernel/panic.h>
#include <kernel/proc.h>
#include <kernel/vfs/request.h>
-#include <kernel/vfs/root.h>
#include <shared/mem.h>
void vfsreq_create(struct vfs_request req_) {