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
{{ message }}
This repository was archived by the owner on Mar 7, 2021. It is now read-only.
Even though you'll need the unstable compiler for a while for this crate, modules themselves should be possible to write in stable Rust, in the same way that libstd itself requires unstable but can be used from stable Rust.
Right now hello-world uses #![feature(alloc)] to use alloc::borrow::ToOwned and alloc::String. Both alloc::borrow and alloc::string are stably re-exported in libstd. So we should do the same thing. Strictly speaking, this permits those modules to change as long as libstd makes an API-compatible facade, but practically that's unlikely to happen and if it does we can just steal whatever facade libstd comes up with (or in the worst case, take a semver hit).
Potentially the way to do this is to re-export a module named std that contains a subset of what's in actual libstd, with the intention of consumers doing
#[macro_use]
extern crate linux_kernel_module;
use linux_kernel_module::std;
use linux_kernel_module::std::prelude::v1::*;
That way, those things from std that do/can exist in kernelspace can just be used like normal.