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

HermitOS Support #177

Closed
notgull opened this issue Jan 13, 2024 · 7 comments · Fixed by #194
Closed

HermitOS Support #177

notgull opened this issue Jan 13, 2024 · 7 comments · Fixed by #194

Comments

@notgull
Copy link
Member

notgull commented Jan 13, 2024

x86_64-unknown-hermit appears to have a poll function similar to Unix. Since we already have a poll-based backend we should be able to integrate it into here.

However from a brief look I can't see whether or not it has an equivalent to pipe or eventfd, which would be needed to implement support here.

@notgull
Copy link
Member Author

notgull commented Jan 27, 2024

@stlankes @mkroening It looks like you are the maintainers of HermitOS. Do you have any insight here?

@stlankes
Copy link

I am currently working on it. It will be there in the near future.

@stlankes
Copy link

stlankes commented Feb 5, 2024

I added a system call poll. Maybe it helps.

@notgull
Copy link
Member Author

notgull commented Feb 6, 2024

I added a system call poll. Maybe it helps.

Thank you! The other thing we need is the ability to wake up the poll from another thread. In Unix, there is an eventfd or pipe, which can be woken up in order to wake up the poll call. In Windows, there is a PostQueuedCompletionStatus function that can be used to wake up a thread waiting on a poll. I'm not sure what's right for HermitOS.

@stlankes
Copy link

stlankes commented Feb 6, 2024

Yeah, I think that I will add something like eventfd

@notgull
Copy link
Member Author

notgull commented Feb 6, 2024

@stlankes Actually, if we're adding syscalls to Hermit to support this, what would be your opinion on an epoll or kqueue-like API? The poll backend in polling is alright, but just by the nature of poll we can't efficiently poll more than a few thousand sockets depending on the hardware.

It would be preferred to have a kernel API like epoll/kqueue/Solaris event ports that can handle adding/modifying/removing interest in FDs in a scalable fashion.

@stlankes
Copy link

stlankes commented Feb 6, 2024

I know and we are working on it. But it needs some time.

notgull added a commit that referenced this issue 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

Signed-off-by: John Nunley <dev@notgull.net>
notgull added a commit that referenced this issue Mar 13, 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

Signed-off-by: John Nunley <dev@notgull.net>
notgull added a commit that referenced this issue Mar 13, 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

Signed-off-by: John Nunley <dev@notgull.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants