Repository navigation
feat: drop userland dependency from kernel - #742
Merged
Merged
Conversation
ytakano
approved these changes
Oct 26, 2026
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR inverts dependencies between the kernel and the userland.
Now, the kernel is independent from the userland. On the other hand, the userland depends on the kernel.
Now, the kernel is a library crate. Its new
build.rsscript generates the appropriate linker script and stores it in Cargo's build directory, with name theawkernel.ldThe userland is now a binary crate with the main function. Users mark their main function with the new
#[awkernel::main]macro. This is typical in crates such as tokio or embassy-executor.The main advantage of this change is that now users can create a new userland repository and use awkernel as a third-party dependency in the Cargo.toml. Somehow, developing the kernel and developing applications is now completely isolated.
This way, changing the application does not imply recompiling the kernel. Also, it is not necessary to propagate user-specific features to the kernel. If there is a new user features (e.g., test_dvfs), the kernel does not need to handle it.
I also included a
userland_extern_templateisolated Rust workspace as an illustrative example of how users can create their own userland. This might be helpful to understand the benefits of this redesign.How was this PR tested?
scripts/ci.shpasses on my machine (macOS and Ubuntu).