Nucleus
Barry Virtual File System 5acaf74 (3 years, 3 months ago)
diff --git a/kernel/main.c b/kernel/main.c
index bd16204..3655743 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -9,6 +9,7 @@
#include <nucleus/panic.h>
#include <nucleus/memory.h>
#include <nucleus/task.h>
+#include <nucleus/vfs.h>
#include "multiboot.h"
#include "desc.h"
#include "acpi/acpi.h"
@@ -65,6 +66,8 @@ kmain(uint32_t esp, struct MultibootInfo *mbinfo)
init_paging();
/* Initialise multitasking */
init_tasking();
+ /* Initialise the VFS */
+ init_vfs();
panic("End of kernel!");
}
diff --git a/vfs/inode.c b/vfs/inode.c
index 77b23ad..6f49c67 100644
--- a/vfs/inode.c
+++ b/vfs/inode.c
@@ -9,7 +9,6 @@
#include <nucleus/object.h>
#include <nucleus/memory.h>
-#include <nucleus/cache.h>
#include <nucleus/vfs.h>
static void inode_new(Object *);
diff --git a/vfs/tmpfs/super.c b/vfs/tmpfs/super.c
new file mode 100644
index 0000000..989d2c0
--- /dev/null
+++ b/vfs/tmpfs/super.c
@@ -0,0 +1,11 @@
+#include <nucleus/vfs.h>
+
+/* Mount a tmpfs instance */
+Inode *
+tmpfs_mount(FSType *type, int flags, const char *dev, void *data)
+{
+// SuperBlock *super = new(&superBlockType);
+
+// super->type =
+ return NULL;
+}
diff --git a/vfs/vfs.c b/vfs/vfs.c
new file mode 100644
index 0000000..2f53c99
--- /dev/null
+++ b/vfs/vfs.c
@@ -0,0 +1,23 @@
+/*
+ * This file controls the Virtual File System for the kernel. It implements a
+ * generic File System, which can hook other File Systems. This forms a key
+ * part of the kernel, and is used for loading programs and some higher-level
+ * IPC and device management.
+ */
+
+#include <nucleus/object.h>
+#include <nucleus/vfs.h>
+
+#include <nucleus/task.h>
+#include "namespace.h"
+
+Inode *tmpfs_mount(FSType *type, int flags, const char *dev, void *data);
+
+/* Initialise the Virtual File System */
+void
+init_vfs(void)
+{
+ register_fstype("tmpfs", tmpfs_mount);
+
+ mount("tmpfs", NULL, "tmpfs", 0, NULL);
+}