generated from erix/meta
WIP: Own loaded kernel and library allocations through handover #34
No reviewers
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/bootloader!34
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/loaded-kernel-image-grants"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary and rationale
Keep the kernel and each resolved shared library in original UEFI allocation owners through linking and handover. Describe their real allocations and exact PT_LOAD spans so the kernel can retain running libraries without granting a virtual hull across gaps.
Tracking and scope
Implements #33 atop #32 and composes the explicit runtime-provider contract from #36. Selects lib-handoff#13 and coordinates kernel#123 and kernel#143. Native image and SMP acceptance remains open.
Architecture, authority and failure behavior
Each image allocation immediately enters a unique owner. Copies and relocations require that original mutable owner; sealing removes those interfaces. Check initialized-byte/BSS compatibility and ELF alignment before loading. On failure, release images in reverse order; uncertain release retains custody and fail-stops.
Retain whole allocations, including holes, while mapping only the normalized segment page union. Compatible shared pages combine their page-granular policy; effective W+X refuses. Preserve original ELF flags and verify primary leaf backing and permissions. Cache selectors describe the actual PTE encoding, with PAT/MTRR meaning handled separately.
A prepared transfer binds the real image, table, BSP stack, handoff, source-image and startup owners before exit. Before any exit attempt, errors may return for cleanup. After an attempt, unrecoverable errors halt with original owners retained; stale map keys retry without allocating. The final raw memory partition must still match the prepared handoff, allowing equivalent descriptor splits and merges. Successful exit masks interrupts. Fixed nonreturning assembly withdraws old global translations, switches CR3 and the owned RSP, checks control state and jumps to the kernel. No Rust stack or metadata access follows the root switch. Global identity aliases and AP policy remain part of the coordinated native work.
Validation evidence
The compiled controls exercise the emitted transition instructions. They do not substitute for firmware or guest execution.
Review checklist
The allocation ledger and nonreturning handover are implemented, including safe handling of partial firmware exit and final memory-map changes. This also composes #36 without restoring prefix-based symbol guesses or map-authorized relocation writes. Coordinated native admission with the kernel consumer remains open.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.