You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#162 removed support for WASI, as it was too difficult/annoying to port.
Additionally, a new Rust nightly totally broke WASI by switching from wasi_unstable to wasi_preview_snapshot1 without any warning, reminding us that WASI is still unstable. #142 more or less added half-working fixes for that, but WASI hasn't properly worked since then.
The main advantage of using WASI at the moment (compared to wasm32-unknown-unknown) is that Instant::now() doesn't panic and panic messages are automatically printed on stderr.
The latter can be "fixed" by having a custom panic handler.
WASI should be implemented by translating WASI function calls into messages. The problem with that approach is that the PIDs of emitted messages should be correct, but if we do so then the code will simply send back the answer as if it was directly emitted by the process.
I can see four approaches to implementing WASI again:
Introduce the concept of messages whose answer should or should not be passed to the WASM VM. That makes things a bit more complex again.
Translate calls to WASI functions ahead of time by directly modifying the WASM code that is being loaded.
Add a layer below the IPC layer that translates WASI extrinsic calls into other extrinsic calls. Unfortunately that would require writing intermediary data to the VM's memory for it to be picked up by the IPC layer.
Add a layer between processes.rs and ipc.rs that interprets all extrinsics and has the concept of sending/receiving/cancelling messages in its API.
I like option #4, as it would also clean up a bit the code of ipc.rs.
The text was updated successfully, but these errors were encountered:
One thing to have in mind is that we want the content of the scheduler module to be multithreaded at some point. In this regard, the functions read_memory and write_memory would be extremely hard to implement.
This kind of disqualifies option 1.
#162 removed support for WASI, as it was too difficult/annoying to port.
Additionally, a new Rust nightly totally broke WASI by switching from
wasi_unstable
towasi_preview_snapshot1
without any warning, reminding us that WASI is still unstable. #142 more or less added half-working fixes for that, but WASI hasn't properly worked since then.The main advantage of using WASI at the moment (compared to
wasm32-unknown-unknown
) is thatInstant::now()
doesn't panic and panic messages are automatically printed on stderr.The latter can be "fixed" by having a custom panic handler.
Last working state: https://github.com/tomaka/redshirt/tree/9b74e7bac86c73a8b9f78835627014675e3c860f/kernel/hosted-wasi
WASI should be implemented by translating WASI function calls into messages. The problem with that approach is that the PIDs of emitted messages should be correct, but if we do so then the code will simply send back the answer as if it was directly emitted by the process.
I can see four approaches to implementing WASI again:
processes.rs
andipc.rs
that interprets all extrinsics and has the concept of sending/receiving/cancelling messages in its API.I like option #4, as it would also clean up a bit the code of
ipc.rs
.The text was updated successfully, but these errors were encountered: