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 support for HermitOS #194

Merged
merged 5 commits into from
Mar 13, 2024
Merged

Add support for HermitOS #194

merged 5 commits into from
Mar 13, 2024

Conversation

notgull
Copy link
Member

@notgull notgull commented Feb 25, 2024

HermitOS is a microkernel target aiming to provide a simple OS for
virtualized applications. It recently added support for the poll() and
eventfd() system calls, which means we can target it with our poll()
based backend.

Hermit does not have a traditional libc; instead it uses hermit-abi.
However rustix does not support using hermit-abi as its underlying
layer yet. So we have to build a shim layer until it does.

Closes #177
cc bytecodealliance/rustix#1012
cc @stlankes

@notgull notgull requested a review from fogti February 26, 2024 00:20
src/poll.rs Outdated Show resolved Hide resolved
@stlankes
Copy link

Looks good from my side! However, we have an issue last_os_error() and it doesn't work like expected. But we are able to fix it. I will give you a hit, it it works like expected.

@notgull
Copy link
Member Author

notgull commented Feb 28, 2024

Looks good from my side! However, we have an issue last_os_error() and it doesn't work like expected. But we are able to fix it. I will give you a hit, it it works like expected.

Could you elaborate? What error is being returned?

@stlankes
Copy link

In std we determine the last error code in a different way and ignored last_os_error. We just don't use it. To solve it, we submit rust-lang/rust#121765. In the current stage, I would directly use hermit-abi to get the last error code.

@notgull
Copy link
Member Author

notgull commented Mar 2, 2024

@stlankes I've fixed it to use get_errno instead of last_os_error, can you take another look?

src/poll.rs Outdated Show resolved Hide resolved
src/poll.rs Outdated Show resolved Hide resolved
HermitOS is a microkernel target aiming to provide a simple OS for
virtualized applications. It recently added support for the poll() and
eventfd() system calls, which means we can target it with our poll()
based backend.

Hermit does not have a traditional libc; instead it uses hermit-abi.
However rustix does not support using hermit-abi as its underlying
layer yet. So we have to build a shim layer until it does.

Closes #177
cc bytecodealliance/rustix#1012

Signed-off-by: John Nunley <[email protected]>
Signed-off-by: John Nunley <[email protected]>
According to @stlankes this causes strange errors in Hermit proper.

Signed-off-by: John Nunley <[email protected]>
Check 'x < 0' instead of 'x == -1'

Signed-off-by: John Nunley <[email protected]>
@notgull notgull merged commit 50454d1 into master Mar 13, 2024
24 checks passed
@notgull notgull deleted the notgull/hermit branch March 13, 2024 04:33
@notgull notgull mentioned this pull request Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

HermitOS Support
3 participants