Skip to content

Rework kernel loader build system#346

Merged
nspin merged 21 commits into
seL4:mainfrom
nspin:pr/rework-kernel-loader-build
May 15, 2026
Merged

Rework kernel loader build system#346
nspin merged 21 commits into
seL4:mainfrom
nspin:pr/rework-kernel-loader-build

Conversation

@nspin
Copy link
Copy Markdown
Member

@nspin nspin commented May 15, 2026

This PR greatly simplifies the kernel loader's build system.

Before this PR, page tables were embedded into the kernel loader source by its build.rs script. This approach made clever use of the linker to construct these page tables at a higher level, but the benefits were outweighed by how unusual the code ended up being.

This PR moves page table construction and embedding into the sel4-kernel-loader-add-payload program. Page tables are now added to the kernel loader in new segments along with kernel/root task segment data. The code is now much easier to understand. Page tables are now conceived of and constructed to the binary level all at once, and lots of type-level logic has been moved to the value-level.

This PR also replaces the more custom in-place payload (de)serialization approach with the rkyv crate, which we recently applied to the CapDL initializer in #297.

nspin added 21 commits May 15, 2026 01:20
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
From build.rs to -add-payload tool

Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
@nspin nspin merged commit efef73c into seL4:main May 15, 2026
14 checks passed
@nspin nspin deleted the pr/rework-kernel-loader-build branch May 15, 2026 08:47
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.

1 participant