Virtual File System #10

Merged
apio merged 7 commits from vfs into main 2022-10-10 18:25:43 +00:00
Owner

This is still a work in progress, but is the beginnings of a VFS in the kernel, which will enable passing files to userspace, mounting several filesystems (and pseudo-filesystems) and more...

This is still a work in progress, but is the beginnings of a VFS in the kernel, which will enable passing files to userspace, mounting several filesystems (and pseudo-filesystems) and more...
apio added the
enhancement
label 2022-10-09 19:23:01 +00:00
apio self-assigned this 2022-10-09 19:23:01 +00:00
apio added 3 commits 2022-10-09 19:23:01 +00:00
apio added 1 commit 2022-10-09 19:30:45 +00:00
There is no need for any kind of 32-bit compatibility.
apio added 1 commit 2022-10-10 16:46:42 +00:00
Finally, resolve_path: a function which takes a path (/etc/fstab for example), and walks the VFS:
In this case, it would start with the root FS node, and ask it: "do you have a directory/file named etc?"
The node could say 'yes', 'no', or 'i'm not a directory, I'm a file' (should not be the case for the VFS root, but for the other ones it could be)
If it says yes, we continue and ask the child if it has a file named fstab. Etc...
apio added 1 commit 2022-10-10 17:00:30 +00:00
apio added 1 commit 2022-10-10 18:21:53 +00:00
Kernel: Implement a descriptor struct which stores the opened node and read offset, and give each task 8 of those.
Implement three syscalls: sys_read, sys_open and sys_close (sys_write still writes to the console instead of using a fd, for now)
Implement three new errors: ENOENT, EBADF and EMFILE.

libc: Implement the new errors, and the new syscalls in syscall().
Also fix _RETURN_WITH_ERRNO() to set errno correctly, which was making strerror() return null, thus crashing perror().

userspace: make init demonstrate the new file API.
Author
Owner

This needs:

  • libc wrappers
  • adding the C FILE* API to libc with this
  • more actions
  • more VFS functionality

But I think this is functional enough that it can be merged.

This needs: - libc wrappers - adding the C FILE* API to libc with this - more actions - more VFS functionality But I think this is functional enough that it can be merged.
apio changed title from WIP: Virtual File System to Virtual File System 2022-10-10 18:25:25 +00:00
apio merged commit 1b84c443fe into main 2022-10-10 18:25:43 +00:00
apio deleted branch vfs 2022-10-10 18:25:43 +00:00
apio referenced this issue from a commit 2022-10-10 18:25:43 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: apio/Luna#10
No description provided.