Skip to content

feat: drop userland dependency from kernel - #742

Merged
ytakano merged 5 commits into
tier4:mainfrom
romancardenas:drop-userland-from-kernel
Oct 26, 2026
Merged

ytakano merged 5 commits into
tier4:mainfrom
romancardenas:drop-userland-from-kernel

Conversation

@romancardenas

Copy link
Copy Markdown
Contributor

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.rs script generates the appropriate linker script and stores it in Cargo's build directory, with name the awkernel.ld

The 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_template isolated 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.sh passes on my machine (macOS and Ubuntu).
  • Apps in userland and userland_extern_template work in x86 (QEMU) and Aarch64 (raspberry 4)

@ytakano
ytakano merged commit fdefdf1 into tier4:main Oct 26, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants