Skip to content

Populate pr_Arguments on the fake struct Process - #89

Merged
sidick merged 1 commit into
mainfrom
fix-pr-arguments-field
Sep 19, 2026
Merged

sidick merged 1 commit into
mainfrom
fix-pr-arguments-field

Conversation

@sidick

@sidick sidick commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • volamos sets A0/D0 to the command-line buffer at process entry, matching real AmigaOS's RunCommand/CreateNewProc entry convention, but never populates struct Process's pr_Arguments field — it stayed permanently NULL.
  • Found running the real sidick/micropython Amiga port under volamos: micropython.standard script.py always dropped into the REPL instead of running the script, because that port's own startup code reads argv from pr_Arguments rather than (only) A0/D0.
  • Cross-checked against vamos (amitools' Process.init_args()), which does set this field the same way — confirming this is a volamos gap, not a port bug.
  • Adds PR_ARGUMENTS_OFFSET (204, verified against NDK 3.2's <dos/dosextens.h>) and writes pr_Arguments = args_addr alongside the existing A0/D0 setup in Runtime::new.

Test plan

  • cargo test — all 856 tests pass (one new regression test: pr_arguments_points_at_the_same_command_line_buffer_as_a0)
  • Manually verified: micropython.standard WORK:examples/hello.py now runs the script directly (previously always fell back to REPL, sys.argv == [])
  • Manually verified: platform_info.py and catalog_lookup.py examples also run correctly with the fix

🤖 Generated with Claude Code

https://claude.ai/code/session_01CjVfTPHtTpowd7YqhcjXJW

A0/D0 carry the command-line buffer at process entry, but real
AmigaOS also exposes the same string later via struct Process's
pr_Arguments field (RunCommand/CreateNewProc set both). volamos only
ever set A0/D0, leaving pr_Arguments permanently NULL.

Found running the real sidick/micropython Amiga port: its startup
reads argv from pr_Arguments rather than A0/D0, so it always saw "no
arguments" and fell back to its REPL even when a real script path was
passed on the command line -- confirmed by cross-checking against
vamos, which does populate this field.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CjVfTPHtTpowd7YqhcjXJW
@sidick
sidick merged commit d3af261 into main Sep 19, 2026
9 checks passed
@sidick
sidick deleted the fix-pr-arguments-field branch September 19, 2026 19:13
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