summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/proc.c3
-rw-r--r--src/kernel/vfs/mount.c15
-rw-r--r--src/kernel/vfs/mount.h3
3 files changed, 20 insertions, 1 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c
index c7963f0..022de79 100644
--- a/src/kernel/proc.c
+++ b/src/kernel/proc.c
@@ -3,6 +3,7 @@
#include <kernel/panic.h>
#include <kernel/proc.h>
#include <kernel/util.h>
+#include <kernel/vfs/mount.h>
#include <shared/magic.h>
#include <stdint.h>
@@ -17,7 +18,7 @@ struct process *process_seed(void) {
proc->sibling = NULL;
proc->child = NULL;
proc->parent = NULL;
- proc->mount = NULL;
+ proc->mount = vfs_mount_seed();
proc->id = next_pid++;
process_first = proc;
diff --git a/src/kernel/vfs/mount.c b/src/kernel/vfs/mount.c
new file mode 100644
index 0000000..be33b6b
--- /dev/null
+++ b/src/kernel/vfs/mount.c
@@ -0,0 +1,15 @@
+#include <kernel/mem.h>
+#include <kernel/vfs/mount.h>
+
+struct vfs_mount *vfs_mount_seed(void) {
+ struct vfs_mount *mount = kmalloc(sizeof(struct vfs_mount));
+ *mount = (struct vfs_mount){
+ .prev = NULL,
+ .prefix = "/tty",
+ .prefix_len = 4,
+ .fd = {
+ .type = FD_SPECIAL_TTY,
+ },
+ };
+ return mount;
+}
diff --git a/src/kernel/vfs/mount.h b/src/kernel/vfs/mount.h
index 3e9d8ae..982f951 100644
--- a/src/kernel/vfs/mount.h
+++ b/src/kernel/vfs/mount.h
@@ -7,3 +7,6 @@ struct vfs_mount {
size_t prefix_len;
struct fd fd;
};
+
+// prepares init's filesystem view
+struct vfs_mount *vfs_mount_seed(void);