fs: Initial VFS port

This commit is contained in:
2026-10-25 18:35:03 +01:00
parent efe1feb852
commit d14f895288
18 changed files with 3296 additions and 23 deletions
+20 -2
View File
@@ -1,3 +1,21 @@
#include <zinnia/vfs.h>
// SPDX-License-Identifier: ISC
void vfs_init() {}
#include <zinnia/alloc.h>
#include <zinnia/assert.h>
#include <zinnia/initgraph.h>
#include <zinnia/vfs.h>
#include "internal.h"
static void vfs_stage_init(struct boot_info* info) {
// Mount a tmpfs as root.
struct vfs_mount* tmpfs;
errno_t status = vfs_mount("tmpfs", 0, nullptr, &tmpfs);
assert(status == 0, "Unable to mount the root tmpfs (%i)", status);
struct vfs_path root = {.mount = tmpfs, .entry = tmpfs->root};
vfs_set_root(root);
vfs_mount_unref(tmpfs);
}
INIT_TASK(vfs_stage, "fs.vfs", vfs_stage_init);
INIT_DEPENDS(vfs_stage, mem_stage);