VFSaur restructuring
This commit is contained in:
parent
1ec9d0fd46
commit
2fb17ac610
|
@ -1,26 +1,43 @@
|
||||||
stn := @use("stn");
|
stn := @use("stn");
|
||||||
|
|
||||||
.{string, buffer, log} := 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 {
|
main := fn(): int {
|
||||||
log.info("VFSaur starting.\0")
|
log.info("VFSaur starting.\0")
|
||||||
vfs_buff := buffer.create("VFS\0")
|
vfs_buff := buffer.create("VFS\0")
|
||||||
|
|
||||||
full_path := "acs:/path/to/a/file\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, '/')
|
split := string.split(full_path, '/')
|
||||||
root := split.next()
|
root := split.next()
|
||||||
path := split.next()
|
path := split.next()
|
||||||
|
|
||||||
if root == null {
|
if root == null {
|
||||||
return 1
|
log.error("Root is null.\0")
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
if path == null {
|
if path == null {
|
||||||
return 2
|
log.error("Path is null.\0")
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
|
return OSPath.(root, path)
|
||||||
log.info(root)
|
|
||||||
log.info(path)
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
|
@ -50,8 +50,8 @@ resolution = "1024x768x24"
|
||||||
# [boot.limine.ableos.modules.angels_halo]
|
# [boot.limine.ableos.modules.angels_halo]
|
||||||
# path = "boot:///angels_halo.hbf"
|
# path = "boot:///angels_halo.hbf"
|
||||||
|
|
||||||
[boot.limine.ableos.modules.test]
|
#[boot.limine.ableos.modules.test]
|
||||||
path = "boot:///test.hbf"
|
#path = "boot:///test.hbf"
|
||||||
|
|
||||||
# [boot.limine.ableos.modules.vfsaur]
|
[boot.limine.ableos.modules.vfsaur]
|
||||||
# path = "boot:///vfsaur.hbf"
|
path = "boot:///vfsaur.hbf"
|
||||||
|
|
Loading…
Reference in a new issue