Volume-centric VFS implementation
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m41s

This commit is contained in:
2026-02-25 08:53:54 +01:00
parent 62a6543dab
commit 704db2dfa4
26 changed files with 441 additions and 406 deletions

View File

@@ -57,7 +57,7 @@ void bootmain (void) {
struct device* ramdisk_device = device_find (RAMDISK_DEVICE);
struct reschedule_ctx rctx = {.cpu = thiscpu, .reschedule = false};
int ret = vfs_create_mountpoint ("ramdisk", VFS_TARFS, ramdisk_device, NULL, &rctx);
int ret = vfs_create_volume ("ramdisk", VFS_TARFS, ramdisk_device, NULL, &rctx);
if (ret < 0) {
DEBUG ("could not mount ramdisk! (%d)\n", ret);

View File

@@ -1,6 +1,7 @@
#include <amd64/gdt.h>
#include <amd64/proc.h>
#include <aux/elf.h>
#include <fs/vfs.h>
#include <libk/align.h>
#include <libk/list.h>
#include <libk/rbtree.h>
@@ -116,6 +117,7 @@ void proc_cleanup (struct proc* proc, struct reschedule_ctx* rctx) {
procgroup_detach (proc->procgroup, proc, rctx);
vfs_volume_close (proc, proc->cwv, rctx);
proc_free_pid (proc->pid);
/* clean the process */
free (proc);

View File

@@ -5,6 +5,7 @@
#include <amd64/mm.h>
#include <amd64/msr-index.h>
#include <amd64/msr.h>
#include <fs/vfs.h>
#include <libk/std.h>
#include <libk/string.h>
#include <limine/requests.h>
@@ -99,7 +100,9 @@ static void smp_bootstrap (struct limine_mp_info* mp_info) {
atomic_fetch_sub (&cpu_counter, 1);
struct proc* spin_proc = proc_from_file (NULL, "ramdisk", "/spin");
struct reschedule_ctx rctx = {.cpu = NULL, .reschedule = false};
struct proc* spin_proc = proc_from_file (VFS_KERNEL, "ramdisk", "/spin", &rctx);
proc_register (spin_proc, thiscpu, NULL);
spin_lock (&spin_proc->cpu->lock);