Skip to content

UEFI target groundwork: runtime: split baremetal memory setup#5360

Open
sparques wants to merge 1 commit intotinygo-org:devfrom
sparques:pr/runtime-baremetal-memory
Open

UEFI target groundwork: runtime: split baremetal memory setup#5360
sparques wants to merge 1 commit intotinygo-org:devfrom
sparques:pr/runtime-baremetal-memory

Conversation

@sparques
Copy link
Copy Markdown
Contributor

@sparques sparques commented May 1, 2026

I am back with another attempt trying to get UEFI as a target.

Summary:

This PR moves baremetal-specific memory symbol declarations and initialization out of src/runtime/baremetal.go into a separate file, src/runtime/baremetal_memory.go.

The extracted code covers:

  • _heap_start / _heap_end
  • _globals_start / _globals_end
  • _stack_top
  • the default growHeap() implementation for baremetal targets

Why:

baremetal.go currently mixes general baremetal runtime behavior with the default linker-symbol-based memory layout. Splitting the memory setup into its own file makes that boundary explicit and makes it easier for targets with nonstandard memory initialization to evolve without adding more special cases to the main baremetal runtime file.
For my purposes, eventually baremetal_memory.go will have a //go:build baremetal && !uefi or something to that effect.

Behavior:

This is intended to be a pure refactor. There should be no functional change for existing baremetal targets.

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