Skip to content

Match real Kickstart's CMP.W version check in OpenLibrary - #92

Merged
sidick merged 1 commit into
mainfrom
fix-openlibrary-version-word-compare
Sep 20, 2026
Merged

sidick merged 1 commit into
mainfrom
fix-openlibrary-version-word-compare

Conversation

@sidick

@sidick sidick commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • A recently-reported AROS bug fix found that real Kickstart ROMs check lib_Version in OpenLibrary with a 68000 CMP.W, so garbage in the high word of the requested-version register (e.g. $30000000 in D0) is silently ignored — AROS's C implementation instead compared the full 32-bit value and wrongly refused such opens.
  • volamos had the identical bug: open_library_handler read the full 32-bit D0 and both version-check sites (after_init, reopen in execlib.rs) compared it as a full u32 against lib_Version.
  • Fixed by masking the requested version to its low 16 bits only at the two comparison sites; D0 itself is left untouched so it's still passed through unmodified to the library's Open vector, matching real hardware.

Test plan

  • New regression test version_check_ignores_high_word_garbage (mirrors the existing version_refusal_returns_null test) asserts OpenLibrary(name, $30000000) succeeds against test.library's real lib_Version (1).
  • cargo test --workspace — 860 passed, 0 failed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HKKqpHMU8Pg4yZuxG924Gu

A recent AROS fix ("Frontier 2") found real ROMs check lib_Version
with a 68000 CMP.W, so garbage in the high word of the requested
version (e.g. $30000000 in D0) is silently ignored. volamos compared
the full 32-bit register value, reproducing AROS's now-fixed bug
instead of real hardware. Mask the requested version to its low word
only at the comparison in after_init/reopen; D0 itself is left
untouched for the Open vector, matching real hardware.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HKKqpHMU8Pg4yZuxG924Gu
@sidick
sidick merged commit a6b72aa into main Sep 20, 2026
9 checks passed
@sidick
sidick deleted the fix-openlibrary-version-word-compare branch September 20, 2026 20:17
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