Hello user process

This commit is contained in:
2025-09-01 23:22:47 +02:00
parent 13ab117b1b
commit 2015e0e0aa
28 changed files with 744 additions and 65 deletions

View File

@ -23,10 +23,15 @@ static const char *vfs_strings[] = {
};
enum {
VFS_CREATE_DIR,
VFS_CREATE_FILE,
VFS_TYPE_DIR,
VFS_TYPE_FILE,
};
typedef struct VfsStat {
size_t size;
int32_t type;
} VfsStat;
typedef struct VfsMountPoint {
bool taken;
uint8_t label[VFS_MOUNTPOINT_LABEL_MAX];
@ -34,6 +39,7 @@ typedef struct VfsMountPoint {
StoreDev *backingsd;
int32_t (*read)(struct VfsMountPoint *vmp, const char *path, uint8_t *const buffer, size_t n, size_t off);
int32_t (*stat)(struct VfsMountPoint *vmp, const char *path, struct VfsStat *stat);
int32_t (*write)(struct VfsMountPoint *vmp, const char *path, const uint8_t *const buffer, size_t n, size_t off);
int32_t (*remove)(struct VfsMountPoint *vmp, const char *path);
int32_t (*create)(struct VfsMountPoint *vmp, const char *path, int32_t type);
@ -56,9 +62,11 @@ extern VfsTable VFS_TABLE;
void vfs_init(void);
int32_t vfs_read(char *mountpoint, const char *path, uint8_t *const buffer, size_t n, size_t off);
int32_t vfs_stat(char *mountpoint, const char *path, VfsStat *stat);
int32_t vfs_write(char *mountpoint, const char *path, const uint8_t *const buffer, size_t n, size_t off);
int32_t vfs_remove(char *mountpoint, const char *path);
int32_t vfs_create(char *mountpoint, const char *path, int32_t type);
int32_t vfs_unmount(char *mountpoint);
#endif // VFS_VFS_H_