lib/systems: Add Genode platform definitions #83292
Merged
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.
Motivation for this change
Genode is a post-UNIX operating system framework featuring capability-based security, user-mode drivers, and a kernel-agnostic system ABI. Genode can emulate enough of POSIX that a significant portion of Nixpkgs should work in theory. For demonstrations of Genode on x86 and ARM see the following recordings from FOSDEM'20: https://fosdem.org/2020/schedule/event/uk_sculpt/ https://fosdem.org/2020/schedule/event/uk_genode_armv8/.
This patchs adds the
x86_64-genode
andaarch64-genode
systems tolib/systems
. According to RFC0046 this will be a tier 7 platform, no support, just simple platform definitions. Adding definitions here allows toolchain and porting work to be done in overlays and flakes without relying on a pinned Nixpkgs revision. Even if it takes a long time to port packages over toplatforms.genode
having a crossstdenv
is useful for native Genode development.Porting Nix to Genode has been tried before, however I don't believe it is practical for the foreseeable future. It is however possible to build a Genode hypervisor system with NixOS guest VMs within a single expression, so cross-compilation is still useful.
Things done
I have a working LLVM toolchain and I'm building simple systems that I can boot on my laptop.
The toolchain overlay is at https://git.sr.ht/~ehmry/genodepkgs/tree/master/overlay/. I would like to upstream any LLVM patches I make, so I would prefer to keep the toolchain patches in an overlay until that happens or the situation changes.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)