Skip to content

feat: expose generic UF2/raw/linker pack and QEMU argv helper - #336

Merged
undivisible merged 3 commits into
masterfrom
feat/pack-cli-qemu-harness
Sep 16, 2026
Merged

undivisible merged 3 commits into
masterfrom
feat/pack-cli-qemu-harness

Conversation

@undivisible

@undivisible undivisible commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add in pack uf2|raw|linker over existing native_emit helpers so product OS repos do not reimplement packing.
  • Add native_emit::qemu_harness::QemuRunSpec for deterministic QEMU argv construction (machine/cpu/kernel only).
  • Hex-format linker LENGTH; document the CLI/harness in docs/freestanding-thumbv8m.md.

Product-owned: board capsules, vector tables, SCI-E, UART assertions.

Test plan

  • cargo test --lib qemu_harness
  • cargo test --lib linker_layout
  • cargo test --bin in parse_pack_uf2
  • cargo test --bin in parse_build_swiftpm

Note

Low Risk
Mostly new CLI and library helpers plus parse-time skipping of unrecognized topology syntax; no auth or runtime behavior changes, though skipped blocks are not lowered into core IR.

Overview
Adds in pack uf2|raw|linker, wiring existing native_emit helpers (UF2 packing, raw flash copy, Cortex-M GNU ld script generation) through a new pack command with hex/decimal address parsing and configurable memory layout flags.

Introduces native_emit::qemu_harness::QemuRunSpec to build stable QEMU command lines (machine, optional CPU, kernel, extras) without product-specific UART or timeout logic.

.in parsing now ignores closed-world topology blocks (system, domain, task, grant, port, non-interrupt fn interrupts, etc.) during surface scan and full module decl parsing so in graph / in compile can read files that mix components with Subspace-style system graphs.

Linker script output formats MEMORY region LENGTH in hex; docs and tests cover pack CLI parsing, topology skip, QEMU argv, and linker layout.

Reviewed by Cursor Bugbot for commit 7efaa98. Configure here.

Product repos such as Subspace should consume `in pack` and
`native_emit::qemu_harness` instead of owning duplicate emit helpers.
Board names, UART assertions, and SCI-E stay product-owned.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0a633-0016-766e-a51d-0df6039429ba
Co-authored-by: Max Carter <undivisible@vk.com>
@capy-ai

capy-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Capy couldn't review this pull request because Max's workspace is out of credits, add credits or enable auto-reload to resume automatic reviews.

Open in Capy

@cursor

cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_b183541b-490a-4556-98d5-8d1a6e417f98)

@mergify

mergify Bot commented Sep 16, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Product system graphs mix component decls with system/task/grant/port
blocks. Treat those as skipped surface syntax so `in graph` works
without a second product CLI.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0a633-0016-766e-a51d-0df6039429ba
Co-authored-by: Max Carter <undivisible@vk.com>
@cursor

cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_abb22e99-4544-476c-9590-1084cf11053c)

@undivisible
undivisible merged commit 41faa23 into master Sep 16, 2026
7 checks passed
@undivisible
undivisible deleted the feat/pack-cli-qemu-harness branch September 16, 2026 07:06
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