-
Notifications
You must be signed in to change notification settings - Fork 1
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 terminology and boundaries RFC #2
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions and notes.
proposes we define the following terms to refer to parts of our OS, adapted | ||
from [EROS](https://web.archive.org/web/20160412201504/http://www.coyotos.org/docs/misc/eros-structure.pdf): | ||
the _kernel_, which implements threading and inter-proces communication (IPC) | ||
as a wasm module, the _nucleus_, which implements a small wasm JIT natively, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, the kernel will be a wasm module that runs on the nucleus?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this has been clarified in my latest revision.
from [EROS](https://web.archive.org/web/20160412201504/http://www.coyotos.org/docs/misc/eros-structure.pdf): | ||
the _kernel_, which implements threading and inter-proces communication (IPC) | ||
as a wasm module, the _nucleus_, which implements a small wasm JIT natively, | ||
and the _firmament_, which specifies IPC interfaces for drivers to implement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the firmament an actual "thing", or just a way to define interfaces between drivers and processes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The firmament would be the equivalent of the syscall boundary in a traditional OS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
RFCs. | ||
- The _nucleus_, which implements a small WebAssembly runtime in native code. A | ||
nucleus will implement the minimal set of hardware interfaces required by the | ||
kernel and will likely resemble an exokernel on its surface. A nucleus need not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call about the exokernel-like interface
The Nebulet operating system architecture is defined in terms of four | ||
components: | ||
|
||
- The _kernel_, which implements the core functionality of a microkernel OS: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you be clearer about whether the kernel is a wasm module or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in latest commit.
|
||
interface EthernetNic { | ||
fn send(&mut self, pkt: EthernetPacket) -> Result<()>; | ||
fn send_inplace(&mut self, func: impl Fn(&mut EthernetPacket) -> Result<()>) -> Result<()>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious how send_inplace
would work. The user supplies it a function that takes a EthernetPacket reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See link for an example of a similar function. The idea here is that the network driver can allocate a packet located inside its Tx queue, then the application modifies the packet.
https://github.com/libpnet/libpnet/blob/master/pnet_datalink/src/linux.rs#L231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting! I hadn't thought of that. It'd be difficult to get the packet into the other wasm linear memory without copying, but could be possible through page flipping.
# Drawbacks | ||
[drawbacks]: #drawbacks | ||
|
||
Implementing all drivers as WebAssembly applications may not be able to provide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an important thing to think about. I'm leaning towards being able to dynamically load (or at startup only, depending on the security model) clif ir for drivers without sandboxing overhead, but this remains to be seen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As someone with both a security and networking background, I would argue in favor of statically-compiled drivers, with the nucleus implementing the firmament. That said, I wonder if we can somehow have it both ways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm okay with that. I suppose recompiling the nucleus for each different use-case is fine.
thread/process scheduling and isolation, and inter-process communication | ||
(IPC). These two pieces of functionality will be further specified in future | ||
RFCs. | ||
- The _nucleus_, which implements a small WebAssembly runtime in native code. A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the nucleus is to contain the webassembly compiler and runtime, which are largely architecture independent, should we break it up further? That is, into the compiler/runtime and the HAL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Another boundary, yay!
5a9685b
to
0fa154f
Compare
Thinking about it again, I'm attempting to figure out how we'd implement a microkernel in wasm. So, obviously, it would use the nucleus' hal interface and whatnot, but still. Where is that line drawn? I think it's a good idea to split up the components, but the kernel should be native. |
0fa154f
to
5e8df78
Compare
Rendered