[FEATURE] Hand over original x86 processor startup allocations #28

Open
opened 2026-11-13 08:03:57 +01:00 by erikinkinen · 1 comment
Owner

Problem and motivation

The kernel needs the original paging arena, BSP stack and low-memory scratch allocations before it can start application processors reliably.

Proposed behavior and scope

Allocate separate retained trampoline and real-mode stack pages through the live UEFI services. Emit their actual extents, the original PML4/table arena and the original BSP stack in the BootKernel v2.1 startup record. Build on #26 and the startup-resource wire contract.

Authority, security and reliability

UEFI allocation ownership supplies the physical storage. The record describes that original ownership; it grants no authority by itself. Reserve every retained allocation as bootloader-owned memory through handover. Release partial allocations on failure, and retain storage after successful firmware exit. Derive all addresses from actual allocations.

Acceptance criteria

  • Allocate independent low trampoline and 16-bit stack storage with complete failure cleanup.
  • Serialize original paging and BSP stack extents before firmware-exit retention changes their owners.
  • Preserve bootloader reservations through memory-map normalization and all handoff rebuilds.
  • Cover encoding, bounds, reservation gaps and allocation failures without claiming host descriptors prove native startup.
    • Compile producer controls for wire layout, bounds, reservation gaps and malformed geometry.
    • Exercise actual firmware allocation refusals and partial cleanup in native acceptance.
  • Complete coordinated native 1-, 2- and 4-CPU acceptance with the kernel consumer.

Alternatives and tradeoffs

Fixed scratch addresses and sampled CR3 values cannot establish original allocation ownership. Explicit retained resources require coordinated producer and consumer updates.

Tracking and rollout

Depends on #26 and lib-handoff#8. Select lib-bootimg#4 for its compliant transitive main-branch source identities. Coordinate native activation and acceptance with kernel#11. Keep the new producer separate from artifact publication policy.

## Problem and motivation The kernel needs the original paging arena, BSP stack and low-memory scratch allocations before it can start application processors reliably. ## Proposed behavior and scope Allocate separate retained trampoline and real-mode stack pages through the live UEFI services. Emit their actual extents, the original PML4/table arena and the original BSP stack in the BootKernel v2.1 startup record. Build on #26 and the [startup-resource wire contract](https://git.erikinkinen.fi/erix/lib-handoff/pulls/9). ## Authority, security and reliability UEFI allocation ownership supplies the physical storage. The record describes that original ownership; it grants no authority by itself. Reserve every retained allocation as bootloader-owned memory through handover. Release partial allocations on failure, and retain storage after successful firmware exit. Derive all addresses from actual allocations. ## Acceptance criteria - [x] Allocate independent low trampoline and 16-bit stack storage with complete failure cleanup. - [x] Serialize original paging and BSP stack extents before firmware-exit retention changes their owners. - [x] Preserve bootloader reservations through memory-map normalization and all handoff rebuilds. - [ ] Cover encoding, bounds, reservation gaps and allocation failures without claiming host descriptors prove native startup. - [x] Compile producer controls for wire layout, bounds, reservation gaps and malformed geometry. - [ ] Exercise actual firmware allocation refusals and partial cleanup in native acceptance. - [ ] Complete coordinated native 1-, 2- and 4-CPU acceptance with the kernel consumer. ## Alternatives and tradeoffs Fixed scratch addresses and sampled CR3 values cannot establish original allocation ownership. Explicit retained resources require coordinated producer and consumer updates. ## Tracking and rollout Depends on #26 and [lib-handoff#8](https://git.erikinkinen.fi/erix/lib-handoff/issues/8). Select [lib-bootimg#4](https://git.erikinkinen.fi/erix/lib-bootimg/pulls/4) for its compliant transitive main-branch source identities. Coordinate native activation and acceptance with [kernel#11](https://git.erikinkinen.fi/erix/kernel/issues/11). Keep the new producer separate from artifact publication policy.
erikinkinen added this to the Alpha 1 milestone 2026-11-13 08:03:57 +01:00
Author
Owner

The original-allocation producer is implemented in #29, including scoped low-memory/BSP stack owners, retained memory-map reservations and BootKernel v2.1 serialization. Coordinated native allocation-failure and 1-, 2- and 4-CPU acceptance remain open with the kernel consumer. The matching manual contract is in docs#98.

The original-allocation producer is implemented in #29, including scoped low-memory/BSP stack owners, retained memory-map reservations and BootKernel v2.1 serialization. Coordinated native allocation-failure and 1-, 2- and 4-CPU acceptance remain open with the kernel consumer. The matching manual contract is in [docs#98](https://git.erikinkinen.fi/erix/docs/pulls/98).
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/bootloader#28
No description provided.