From 4560c19652843897445b242be9d932bb18ba0b50 Mon Sep 17 00:00:00 2001 From: Able Date: Sun, 22 Dec 2024 05:47:53 -0600 Subject: [PATCH] VFSaur restructuring --- sysdata/programs/vfsaur/src/main.hb | 35 +++++++++++++++++++++-------- sysdata/system_config.toml | 8 +++---- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/sysdata/programs/vfsaur/src/main.hb b/sysdata/programs/vfsaur/src/main.hb index 53a6ea4..980d768 100644 --- a/sysdata/programs/vfsaur/src/main.hb +++ b/sysdata/programs/vfsaur/src/main.hb @@ -1,26 +1,43 @@ stn := @use("stn"); .{string, buffer, log} := stn; -.{info} := log +.{info} := log; + +.{acs} := stn; +.{BufferID} := acs + +FilesystemServiceListing := struct { + // The Root to match against of the file system + root: ^u8, + // Replace with a slice here soon. + // The buffer to forward fs requests to. + buffer_id: BufferID, +} main := fn(): int { log.info("VFSaur starting.\0") vfs_buff := buffer.create("VFS\0") full_path := "acs:/path/to/a/file\0" + a := parse_str_to_path(full_path) + + return 0 +} + +OSPath := struct {root: ^u8, path: ^u8} + +parse_str_to_path := fn(full_path: ^u8): ?OSPath { split := string.split(full_path, '/') root := split.next() path := split.next() if root == null { - return 1 + log.error("Root is null.\0") + return null } if path == null { - return 2 + log.error("Path is null.\0") + return null } - - log.info(root) - log.info(path) - - return 0 -} \ No newline at end of file + return OSPath.(root, path) +} diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 7c28208..c52eec6 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -50,8 +50,8 @@ path = "boot:///ps2_driver.hbf" # [boot.limine.ableos.modules.angels_halo] # path = "boot:///angels_halo.hbf" -[boot.limine.ableos.modules.test] -path = "boot:///test.hbf" +#[boot.limine.ableos.modules.test] +#path = "boot:///test.hbf" -# [boot.limine.ableos.modules.vfsaur] -# path = "boot:///vfsaur.hbf" +[boot.limine.ableos.modules.vfsaur] +path = "boot:///vfsaur.hbf"