Implement VFS syscalls
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m29s

This commit is contained in:
2026-02-15 21:34:07 +01:00
parent 0f5bd48328
commit 7726fd2f00
19 changed files with 307 additions and 31 deletions

View File

@@ -40,3 +40,15 @@ int device_do (int device_id, int cmd, void* a1, void* a2, void* a3, void* a4) {
}
int exec (const char* path) { return (int)do_syscall (SYS_EXEC, path); }
int open (const char* path) { return (int)do_syscall (SYS_OPEN, path); }
int close (const char* path) { return (int)do_syscall (SYS_CLOSE, path); }
int read (const char* path, size_t off, uint8_t* buffer, size_t size) {
return (int)do_syscall (SYS_READ, path, off, buffer, size);
}
int describe (const char* path, struct fs_desc_buffer* desc) {
return (int)do_syscall (SYS_DESCRIBE, path, desc);
}

View File

@@ -1,6 +1,7 @@
#ifndef _LIBMSL_M_SYSTEM_H
#define _LIBMSL_M_SYSTEM_H
#include <m/fs_desc_buffer.h>
#include <stddef.h>
#include <stdint.h>
@@ -52,4 +53,16 @@ int device_do (int device_id, int cmd, void* a1, void* a2, void* a3, void* a4);
/* Run external ELF program */
int exec (const char* path);
/* Open a file */
int open (const char* path);
/* Close a file */
int close (const char* path);
/* Read a file */
int read (const char* path, size_t off, uint8_t* buffer, size_t size);
/* describe a file */
int describe (const char* path, struct fs_desc_buffer* desc);
#endif // _LIBMSL_M_SYSTEM_H