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

Rust app interface #37

Open
mkschreder opened this issue Oct 7, 2023 · 1 comment
Open

Rust app interface #37

mkschreder opened this issue Oct 7, 2023 · 1 comment

Comments

@mkschreder
Copy link

What about adding rust to Zephyr in such a way that instead of generating bindings for the whole zephyr system, we would simply define a messaging interface for rust and then use zephyr mailbox to communicate between rust and C components? We could for example use cbor as binary format and cddl to define interface messages.

@tylerwhall
Copy link
Owner

I think this is tantamount to defining a stable binary API to Zephyr in general, which could be done, but doesn't need to be specific to Rust.

It would be possible to create a stable C ABI without needing message passing. i.e. if you could define a binary format for the methods and data passed to them, they could be implemented with direct function calls. The real issue is defining the API in a way that satisfies most use cases without being too bloated. Zephyr's design goal seems to be maximizing compile-time configuration to minimize binary size, and the only goal is source-level compatibility. zephyr-rust requires some kconfig features to reasonably support libstd which sets a floor for the kernel size, but the goal is to allow Rust app code to be nearly as efficient as C.

It might make sense for Zephyr to have a stable binary interface for applications. I don't know if anyone is working on something like this, but it might be useful for applications in any language.

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

No branches or pull requests

2 participants