[FEATURE] Retain original runtime images in exact supervisor roots #143

Open
opened 2026-11-13 15:34:00 +01:00 by erikinkinen · 1 comment
Owner

Problem and motivation

The Kernel-only boot module does not retain the independently relocated shared objects used by the running Kernel. Copying all supervisor leaves into ready roots also retains loader, firmware and free-memory aliases without a corresponding source owner.

Proposed behavior and scope

Consume the BootKernel 2.3 runtime-image contract through the genuine one-shot unsafe boot handover. Retain exact whole original Kernel/dependency allocations and replace legacy Kernel-only ownership. Build the supervisor template from the granted PT_LOAD page union and separately retained infrastructure roles, rather than inheriting arbitrary leaves or mapping allocation/virtual hulls.

Retain the actual runtime group across every Kernel/process root and CPU occupation. Preserve typed CPU, heap and table subowners. Decode maximum image permissions separately from effective shared-page policy: compatible RO/RW pages become RW, RO/RX become RX, and writable-executable unions fail. A shared writable page cannot retain a per-byte read-only claim.

Authority, security and reliability

A descriptor, hash, exclusion, address or observed leaf cannot mint an original memory owner. The original unsafe entry is closed and one-shot; failed intake cannot publish partial roles or release executing backing. Original ELF source files remain distinct from relocated runtime memory. Actual source identity and physical/cache policy checks precede template publication.

APIC, framebuffer and physical windows require separate genuine source roles. Inventory missing grants and fail closed instead of accepting copied supervisor mappings. Roots retain backing through switch/readback, invalidation and peer withdrawal; uncertain retirement retains custody.

Acceptance criteria

  • Intake the complete runtime group under an explicit unsafe one-shot original handover; reserve whole allocations and remove duplicate legacy Kernel-only origin.
  • Construct exact supervisor mappings from compatible granted segment pages and explicitly retained infrastructure; exclude unrelated low-memory, loader, firmware, free-memory and allocation-hole aliases.
  • Retain original runtime and child ownership through all Kernel/process roots and physical CPU occupations; preserve cleanup/error and uncertain-withdrawal guarantees.
  • Add original-source, negative and failure controls, pass strict component/native compilation and CI, and document source/lifetime boundaries.
  • Demonstrate the coordinated real release-image behavior on 1, 2 and 4 CPUs with actual producer and consumer sources; no synthetic hardware receipts.

Alternatives and tradeoffs

Widening the Kernel module or retaining source catalog bytes cannot cover distinct relocated allocations. Treating current leaves as ownership preserves ambient aliases. A unique original runtime group plus an explicit allowlist keeps allocation lifetime and precise mapping policy separate.

Tracking and rollout

Implementation: original runtime-image sources, with processor memory policy and the coordinated manual.

Build on the native entry foundation. Coordinate LibHandoff design, the runtime-image codec, the Bootloader allocation-ledger producer, and native private-root activation. Native image acceptance remains open until observed with the actual graph.

## Problem and motivation The Kernel-only boot module does not retain the independently relocated shared objects used by the running Kernel. Copying all supervisor leaves into ready roots also retains loader, firmware and free-memory aliases without a corresponding source owner. ## Proposed behavior and scope Consume the [BootKernel 2.3 runtime-image contract](https://git.erikinkinen.fi/erix/lib-handoff/pulls/13) through the genuine one-shot unsafe boot handover. Retain exact whole original Kernel/dependency allocations and replace legacy Kernel-only ownership. Build the supervisor template from the granted PT_LOAD page union and separately retained infrastructure roles, rather than inheriting arbitrary leaves or mapping allocation/virtual hulls. Retain the actual runtime group across every Kernel/process root and CPU occupation. Preserve typed CPU, heap and table subowners. Decode maximum image permissions separately from effective shared-page policy: compatible RO/RW pages become RW, RO/RX become RX, and writable-executable unions fail. A shared writable page cannot retain a per-byte read-only claim. ## Authority, security and reliability A descriptor, hash, exclusion, address or observed leaf cannot mint an original memory owner. The original unsafe entry is closed and one-shot; failed intake cannot publish partial roles or release executing backing. Original ELF source files remain distinct from relocated runtime memory. Actual source identity and physical/cache policy checks precede template publication. APIC, framebuffer and physical windows require separate genuine source roles. Inventory missing grants and fail closed instead of accepting copied supervisor mappings. Roots retain backing through switch/readback, invalidation and peer withdrawal; uncertain retirement retains custody. ## Acceptance criteria - [x] Intake the complete runtime group under an explicit unsafe one-shot original handover; reserve whole allocations and remove duplicate legacy Kernel-only origin. - [x] Construct exact supervisor mappings from compatible granted segment pages and explicitly retained infrastructure; exclude unrelated low-memory, loader, firmware, free-memory and allocation-hole aliases. - [x] Retain original runtime and child ownership through all Kernel/process roots and physical CPU occupations; preserve cleanup/error and uncertain-withdrawal guarantees. - [x] Add original-source, negative and failure controls, pass strict component/native compilation and CI, and document source/lifetime boundaries. - [ ] Demonstrate the coordinated real release-image behavior on 1, 2 and 4 CPUs with actual producer and consumer sources; no synthetic hardware receipts. ## Alternatives and tradeoffs Widening the Kernel module or retaining source catalog bytes cannot cover distinct relocated allocations. Treating current leaves as ownership preserves ambient aliases. A unique original runtime group plus an explicit allowlist keeps allocation lifetime and precise mapping policy separate. ## Tracking and rollout Implementation: [original runtime-image sources](https://git.erikinkinen.fi/erix/kernel/pulls/146), with [processor memory policy](https://git.erikinkinen.fi/erix/kernel/pulls/144) and [the coordinated manual](https://git.erikinkinen.fi/erix/docs/pulls/102). Build on [the native entry foundation](https://git.erikinkinen.fi/erix/kernel/pulls/141). Coordinate [LibHandoff design](https://git.erikinkinen.fi/erix/lib-handoff/issues/12), [the runtime-image codec](https://git.erikinkinen.fi/erix/lib-handoff/pulls/13), [the Bootloader allocation-ledger producer](https://git.erikinkinen.fi/erix/bootloader/issues/33), and [native private-root activation](https://git.erikinkinen.fi/erix/kernel/pulls/123). Native image acceptance remains open until observed with the actual graph.
erikinkinen added this to the Alpha 1 milestone 2026-11-13 15:34:00 +01:00
Author
Owner

Implemented in #146 with the source-lifetime manual in Docs #102. Exact runtime allocations now feed the supervisor allowlist; file retirement preserves only independently owned readers. Native release-image acceptance on one, two and four CPUs remains open, and debug framebuffer conversion stays closed until its real withdrawal/transfer is implemented.

Implemented in #146 with the source-lifetime manual in [Docs #102](https://git.erikinkinen.fi/erix/docs/pulls/102). Exact runtime allocations now feed the supervisor allowlist; file retirement preserves only independently owned readers. Native release-image acceptance on one, two and four CPUs remains open, and debug framebuffer conversion stays closed until its real withdrawal/transfer is implemented.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/kernel#143
No description provided.