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

@ -18,6 +18,7 @@ VfsTable VFS_TABLE;
void vfs_init_kvfs(VfsMountPoint *mp) {
mp->read = &kvfs_read;
mp->stat = &kvfs_stat;
mp->write = &kvfs_write;
mp->remove = &kvfs_remove;
mp->check = &kvfs_check;
@ -52,6 +53,7 @@ void vfs_init_littlefs(VfsMountPoint *mp) {
}
mp->read = &littlefs_read;
mp->stat = &littlefs_stat;
mp->write = &littlefs_write;
mp->remove = &littlefs_remove;
mp->check = &littlefs_check;
@ -123,6 +125,20 @@ int32_t vfs_read(char *mountpoint, const char *path, uint8_t *const buffer, size
return mp->read(mp, path, buffer, n, off);
}
int32_t vfs_stat(char *mountpoint, const char *path, VfsStat *stat) {
VfsMountPoint *mp = NULL;
spinlock_acquire(&VFS_TABLE.spinlock);
HSHTB_GET(&VFS_TABLE, mountpoints, mountpoint, label, mp);
spinlock_release(&VFS_TABLE.spinlock);
if (mp == NULL) {
return E_NOENTRY;
}
return mp->stat(mp, path, stat);
}
int32_t vfs_create(char *mountpoint, const char *path, int32_t type) {
VfsMountPoint *mp = NULL;