Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basic support of a virtual filesystem #1013

Merged
merged 32 commits into from
Jan 16, 2024
Merged

Conversation

stlankes
Copy link
Contributor

@stlankes stlankes commented Dec 25, 2023

Add basic support of a virtual filesystem (including an in-memory fs). If the kernel is running on top of uhyve, the host system will be mounted at mount point, which is defined by the kernel argument -mount. If this argument is not used, the kernel uses /host as default mount point. If the kernel detects FUSE, the kernel mount the filesystem at the mount point, which is specified by FUSE's tag. In case of Qemu, the tag is specified by the argument -device (e.g. -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=root). In this example, FUSE will be mount at /root.

In addition, the interface for file descriptors is revised and move the usage of raw pointers to the system call implementations.

@stlankes stlankes marked this pull request as draft December 25, 2023 10:40
@stlankes stlankes changed the title ramdisk support add ramdisk support Dec 25, 2023
@stlankes stlankes force-pushed the syscall branch 11 times, most recently from 6a53407 to c205c25 Compare January 3, 2024 21:32
@stlankes stlankes marked this pull request as ready for review January 4, 2024 07:37
@stlankes stlankes force-pushed the syscall branch 12 times, most recently from 449c9dc to bf75717 Compare January 6, 2024 13:26
The virtual filesystem should not be part of the system call
implementation.
Rename feature fs to fuse, because it disables the support of
the fuse file system. For legacy reasons, the feature fs will
enable fuse.
- remove old style
- using of slices instead of raw pointer
@stlankes stlankes force-pushed the syscall branch 5 times, most recently from 4ec0fac to f89dab7 Compare January 9, 2024 16:02
sys_getdents64 is compatible to Linux' system call getdents64.
Consequently, it offers the reusing of an existing ABI.
@stlankes stlankes changed the title add ramdisk support add basic support of virtual filesystem Jan 9, 2024
@stlankes stlankes changed the title add basic support of virtual filesystem add basic support of a virtual filesystem Jan 10, 2024
@mkroening mkroening self-requested a review January 12, 2024 14:58
stlankes added a commit to stlankes/hermit-rs that referenced this pull request Jan 14, 2024
- remove readdir support
- add comment to describe file attributes
- This PR depends on hermit-os/kernel#1013
stlankes added a commit to stlankes/hermit-rs that referenced this pull request Jan 14, 2024
- remove readdir support
- add comment to describe file attributes
- This PR depends on hermit-os/kernel#1013
stlankes added a commit to stlankes/hermit-rs that referenced this pull request Jan 14, 2024
- remove readdir support
- add comment to describe file attributes
- This PR depends on hermit-os/kernel#1013
- according to POSIX standard, the position between file descriptors
  will be shared after a dup operation
Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 👍

@mkroening mkroening added this pull request to the merge queue Jan 16, 2024
Merged via the queue into hermit-os:main with commit 45a07d4 Jan 16, 2024
39 checks passed
stlankes added a commit to stlankes/hermit-rs that referenced this pull request Jan 16, 2024
- remove readdir support
- add comment to describe file attributes
- This PR depends on hermit-os/kernel#1013
stlankes added a commit to stlankes/hermit-rs that referenced this pull request Jan 17, 2024
- remove readdir support
- add comment to describe file attributes
- This PR depends on hermit-os/kernel#1013
stlankes added a commit to hermit-os/hermit-rs that referenced this pull request Jan 17, 2024
* add support of getdents64 to read directory entries

- remove readdir support
- add comment to describe file attributes
- This PR depends on hermit-os/kernel#1013

* add latest version of libhermit

* add test to open a file from the proc filesystem

/etc is not longer mounted and should not be used for a test

* rename some data structures to improve the backward compatability

* minor changes to pass the format check

* add test to read the directory entries

* using hexadecimal numbers instead decimal numbers

- improves the readability

* update kernel module
@mkroening mkroening deleted the syscall branch March 25, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants