diff --git a/docs/copperline-bugreport/0.11.0-serial.log b/docs/copperline-bugreport/0.11.0-serial.log new file mode 100644 index 0000000..c7fd0f3 --- /dev/null +++ b/docs/copperline-bugreport/0.11.0-serial.log @@ -0,0 +1,39 @@ +ROMInfo: 1MiB ROM detected +ROMInfo: ROM region(s).. +ROMInfo: 0x00e00000 - 0x00e7ffff +ROMInfo: 0x00f80000 - 0x00ffffff +Found board 00e80000: mfg=5192 prod=2 size=00010000 serial=00000b00 diag=00000000 +Configuring board: cd=00000468 mfg=5192 prod=2 size=00010000 type=c1 +-> configured, 00e90000 - 00e9ffff +Found board 00e80000: mfg=5192 prod=5 size=00010000 serial=00000000 diag=00000048 +Configuring board: cd=000004b0 mfg=5192 prod=5 size=00010000 type=d1 +-> configured, 00ea0000 - 00eaffff +callroms +Read boot ROM base=00e90000 cd=00000468 type=c1 +Board without boot ROM +Read boot ROM base=00ea0000 cd=000004b0 type=d1 +da_Config=90 +Size=0048 DiagPoint=000e BootPoint=0014 Name=003c +Name='Copperline' +Call boot rom @00c1ba66 board 00ea0000 diag 00c1ba58 configdev 000004b0 +->success +callroms done +00c00000: 00c00000 - 00c80000 00001705 -5 'memory' +00000400: 00000400 - 00080000 00001703 -10 'chip memory' +00c01108: 00f80000 - 01000000 00000400 -128 'Kickstart ROM' +00c01128: 00e00000 - 00e80000 00000400 -128 'Kickstart ROM' +romtaginit +romtaginit done +BEGIN +HOTP0=755224 +HOTP1=287082 +HOTP2=359152 +HOTP3=969429 +HOTP4=338314 +HOTP5=254676 +HOTP6=287922 +HOTP7=162583 +HOTP8=399871 +HOTP9=520489 +DRBG=be491355307bb821bf72d7f115d91156 +END diff --git a/docs/copperline-bugreport/0.11.0-stderr.log b/docs/copperline-bugreport/0.11.0-stderr.log new file mode 100644 index 0000000..c925e1d --- /dev/null +++ b/docs/copperline-bugreport/0.11.0-stderr.log @@ -0,0 +1,19 @@ +[2026-07-25T10:29:48Z INFO copperline::config] no ROM specified; booting bundled AROS (/private/tmp/claude-501/-Users-simond-src-amiauth/112d2853-3264-4e03-90b2-abdf1b359ea6/scratchpad/cl011/Copperline.app/Contents/Resources/aros/aros-amiga-m68k-rom.bin) +[2026-07-25T10:29:48Z INFO copperline] config: cpu=M68000 fpu=false cpu_clock=7.09MHz chip_ram=512K fast_ram=0K slow_ram=512K z3_ram=0K zorro_boards=0 chipset=Ecs (agnus=Ecs8372Rev4 denise=Ocs) video=Pal rom=/private/tmp/claude-501/-Users-simond-src-amiauth/112d2853-3264-4e03-90b2-abdf1b359ea6/scratchpad/cl011/Copperline.app/Contents/Resources/aros/aros-amiga-m68k-rom.bin floppy_drives=1 +[2026-07-25T10:29:48Z INFO copperline] audio: disabled (null sink); no sound +[2026-07-25T10:29:48Z INFO copperline] emulation timing: deterministic core, paced=false +[2026-07-25T10:29:48Z INFO copperline::emulator] extended ROM: /private/tmp/claude-501/-Users-simond-src-amiauth/112d2853-3264-4e03-90b2-abdf1b359ea6/scratchpad/cl011/Copperline.app/Contents/Resources/aros/aros-amiga-m68k-ext.bin at 0xE00000 +[2026-07-25T10:29:48Z INFO copperline::emulator] machine profile: A500 (gate array None, rtc false) +[2026-07-25T10:29:48Z INFO copperline::emulator] real pacing budget: returned m68k cycles plus explicit chip-bus waits +[2026-07-25T10:29:52Z INFO copperline::zorro] zorro II board "Copperline" autoconfigured at 0x00E90000 +[2026-07-25T10:29:52Z INFO copperline::zorro] zorro II board "Copperline services" autoconfigured at 0x00EA0000 +[2026-07-25T10:29:52Z INFO copperline::filesys] filesys: expansion init at board 0x00EA0000, 1 mount(s) +[2026-07-25T10:29:53Z INFO copperline::bus::custom_regs] BPLCON3 write 0x0C00 dropped (OCS Denise); further drops not logged +[2026-07-25T10:29:53Z INFO copperline::filesys] filesys: HOSTFS0: handler started (AmiAuthTest: -> sys) +[2026-07-25T10:29:57Z INFO copperline] benchmark: ran 40.007s emulated to 40.000s target in 8.771s wall, 1997 frames (227.7/s) +[2026-07-25T10:29:57Z INFO copperline] benchmark frame times: p50=3.38ms p90=4.10ms p99=4.85ms max=5.21ms +[2026-07-25T10:29:57Z INFO copperline] benchmark frame times: all 2509 frames within the 20ms budget +[2026-07-25T10:29:57Z INFO copperline::emulator] emu stats: 8.8s elapsed, 40.0s emulated (456.1%), 2509 frames (286.0/s), 18195147 slices (2074416.2/s), ~2.06 MIPS +[2026-07-25T10:29:57Z INFO copperline::bus] video pipeline stats (emu stats): bitplane_fetch calls=13455669 slots=13455669 rows_started=168196 rows_completed=0 time=0.000ms, sprite_fetch calls=4553192 pair_slots=4553192 lines=10532 time=187.508ms +[2026-07-25T10:29:57Z INFO copperline::bus] video pipeline stats (emu stats): collisions calls=0 pixels=0 full_line_scans=0 control_segments=0 time=0.000ms avg=0.0ns/pixel +[2026-07-25T10:29:57Z INFO copperline::bus] video pipeline stats (emu stats): render frames=0 events=0 control_segments=0 playfield_pixels=0 manual_bpl_segments=0 sprite_lines=0 total=0.000ms phases(events=0.000, background=0.000, playfield=0.000, manual_bpl=0.000, sprites=0.000) diff --git a/docs/copperline-bugreport/0.12.0-serial.log b/docs/copperline-bugreport/0.12.0-serial.log new file mode 100644 index 0000000..9a5cbf7 --- /dev/null +++ b/docs/copperline-bugreport/0.12.0-serial.log @@ -0,0 +1,26 @@ +ROMInfo: 1MiB ROM detected +ROMInfo: ROM region(s).. +ROMInfo: 0x00e00000 - 0x00e7ffff +ROMInfo: 0x00f80000 - 0x00ffffff +Found board 00e80000: mfg=5192 prod=2 size=00010000 serial=00000c00 diag=00000000 +Configuring board: cd=00000468 mfg=5192 prod=2 size=00010000 type=c1 +-> configured, 00e90000 - 00e9ffff +Found board 00e80000: mfg=5192 prod=5 size=00010000 serial=00000000 diag=00000048 +Configuring board: cd=000004b0 mfg=5192 prod=5 size=00010000 type=d1 +-> configured, 00ea0000 - 00eaffff +callroms +Read boot ROM base=00e90000 cd=00000468 type=c1 +Board without boot ROM +Read boot ROM base=00ea0000 cd=000004b0 type=d1 +da_Config=90 +Size=0048 DiagPoint=000e BootPoint=0014 Name=003c +Name='Copperline' +Call boot rom @00c1ba66 board 00ea0000 diag 00c1ba58 configdev 000004b0 +->success +callroms done +00c00000: 00c00000 - 00c80000 00001705 -5 'memory' +00000400: 00000400 - 00080000 00001703 -10 'chip memory' +00c01108: 00f80000 - 01000000 00000400 -128 'Kickstart ROM' +00c01128: 00e00000 - 00e80000 00000400 -128 'Kickstart ROM' +romtaginit +romtaginit done diff --git a/docs/copperline-bugreport/0.12.0-stderr.log b/docs/copperline-bugreport/0.12.0-stderr.log new file mode 100644 index 0000000..e38512b --- /dev/null +++ b/docs/copperline-bugreport/0.12.0-stderr.log @@ -0,0 +1,19 @@ +[2026-07-25T10:29:57Z INFO copperline::config] no ROM specified; booting bundled AROS (/private/tmp/claude-501/-Users-simond-src-amiauth/112d2853-3264-4e03-90b2-abdf1b359ea6/scratchpad/cl012/Copperline.app/Contents/Resources/aros/aros-amiga-m68k-rom.bin) +[2026-07-25T10:29:57Z INFO copperline] config: cpu=M68000 fpu=false cpu_clock=7.09MHz chip_ram=512K fast_ram=0K slow_ram=512K z3_ram=0K zorro_boards=0 chipset=Ecs (agnus=Ecs8372Rev4 denise=Ocs) video=Pal rom=/private/tmp/claude-501/-Users-simond-src-amiauth/112d2853-3264-4e03-90b2-abdf1b359ea6/scratchpad/cl012/Copperline.app/Contents/Resources/aros/aros-amiga-m68k-rom.bin floppy_drives=1 +[2026-07-25T10:29:57Z INFO copperline] audio: disabled (null sink); no sound +[2026-07-25T10:29:57Z INFO copperline] emulation timing: deterministic core, paced=false +[2026-07-25T10:29:57Z INFO copperline::emulator] filesys: services board on the Zorro chain (slot 0), 1 mount(s) +[2026-07-25T10:29:57Z INFO copperline::emulator] extended ROM: /private/tmp/claude-501/-Users-simond-src-amiauth/112d2853-3264-4e03-90b2-abdf1b359ea6/scratchpad/cl012/Copperline.app/Contents/Resources/aros/aros-amiga-m68k-ext.bin at 0xE00000 +[2026-07-25T10:29:57Z INFO copperline::emulator] input: port 1 = mouse, port 2 = joystick +[2026-07-25T10:29:57Z INFO copperline::emulator] machine profile: A500 (gate array None, rtc false) +[2026-07-25T10:29:57Z INFO copperline::emulator] real pacing budget: returned m68k cycles plus explicit chip-bus waits +[2026-07-25T10:29:57Z INFO copperline::zorro] zorro II board "Copperline" autoconfigured at 0x00E90000 +[2026-07-25T10:29:58Z INFO copperline::zorro] zorro II board "Copperline services" autoconfigured at 0x00EA0000 +[2026-07-25T10:29:58Z INFO copperline::bus::custom_regs] BPLCON3 write 0x0C00 dropped (OCS Denise); further drops not logged +[2026-07-25T10:30:06Z INFO copperline] benchmark: ran 40.013s emulated to 40.000s target in 8.763s wall, 1999 frames (228.1/s) +[2026-07-25T10:30:06Z INFO copperline] benchmark frame times: p50=3.37ms p90=4.30ms p99=4.74ms max=6.21ms +[2026-07-25T10:30:06Z INFO copperline] benchmark frame times: all 2437 frames within the 20ms budget +[2026-07-25T10:30:06Z INFO copperline::emulator] emu stats: 8.8s elapsed, 40.0s emulated (456.6%), 2437 frames (278.1/s), 6562116 slices (748825.3/s), ~0.72 MIPS +[2026-07-25T10:30:06Z INFO copperline::bus] video pipeline stats (emu stats): bitplane_fetch calls=69560285 slots=69560285 rows_started=434752 rows_completed=0 time=0.000ms, sprite_fetch calls=4553496 pair_slots=4553496 lines=2120 time=228.484ms +[2026-07-25T10:30:06Z INFO copperline::bus] video pipeline stats (emu stats): collisions calls=0 pixels=0 full_line_scans=0 control_segments=0 time=0.000ms avg=0.0ns/pixel +[2026-07-25T10:30:06Z INFO copperline::bus] video pipeline stats (emu stats): render frames=0 events=0 control_segments=0 playfield_pixels=0 manual_bpl_segments=0 sprite_lines=0 total=0.000ms phases(events=0.000, background=0.000, playfield=0.000, manual_bpl=0.000, sprites=0.000) diff --git a/docs/copperline-bugreport/0.13.0-boot-stuck.png b/docs/copperline-bugreport/0.13.0-boot-stuck.png new file mode 100644 index 0000000..0795d4b Binary files /dev/null and b/docs/copperline-bugreport/0.13.0-boot-stuck.png differ diff --git a/docs/copperline-bugreport/0.13.0-serial.log b/docs/copperline-bugreport/0.13.0-serial.log new file mode 100644 index 0000000..149bd60 --- /dev/null +++ b/docs/copperline-bugreport/0.13.0-serial.log @@ -0,0 +1,26 @@ +ROMInfo: 1MiB ROM detected +ROMInfo: ROM region(s).. +ROMInfo: 0x00e00000 - 0x00e7ffff +ROMInfo: 0x00f80000 - 0x00ffffff +Found board 00e80000: mfg=5192 prod=2 size=00010000 serial=00000d00 diag=00000000 +Configuring board: cd=00000468 mfg=5192 prod=2 size=00010000 type=c1 +-> configured, 00e90000 - 00e9ffff +Found board 00e80000: mfg=5192 prod=5 size=00010000 serial=00000000 diag=00000048 +Configuring board: cd=000004b0 mfg=5192 prod=5 size=00010000 type=d1 +-> configured, 00ea0000 - 00eaffff +callroms +Read boot ROM base=00e90000 cd=00000468 type=c1 +Board without boot ROM +Read boot ROM base=00ea0000 cd=000004b0 type=d1 +da_Config=90 +Size=0048 DiagPoint=000e BootPoint=0014 Name=003c +Name='Copperline' +Call boot rom @00c1ba66 board 00ea0000 diag 00c1ba58 configdev 000004b0 +->success +callroms done +00c00000: 00c00000 - 00c80000 00001705 -5 'memory' +00000400: 00000400 - 00080000 00001703 -10 'chip memory' +00c01108: 00f80000 - 01000000 00000400 -128 'Kickstart ROM' +00c01128: 00e00000 - 00e80000 00000400 -128 'Kickstart ROM' +romtaginit +romtaginit done diff --git a/docs/copperline-bugreport/0.13.0-stderr.log b/docs/copperline-bugreport/0.13.0-stderr.log new file mode 100644 index 0000000..3f9c273 --- /dev/null +++ b/docs/copperline-bugreport/0.13.0-stderr.log @@ -0,0 +1,19 @@ +[2026-07-25T10:30:06Z INFO copperline::config] no ROM specified; booting bundled AROS (/opt/homebrew/share/copperline/aros/aros-amiga-m68k-rom.bin) +[2026-07-25T10:30:06Z INFO copperline] config: cpu=M68000 fpu=false cpu_clock=7.09MHz chip_ram=512K fast_ram=0K slow_ram=512K z3_ram=0K zorro_boards=0 chipset=Ecs (agnus=Ecs8372Rev4 denise=Ocs) video=Pal rom=/opt/homebrew/share/copperline/aros/aros-amiga-m68k-rom.bin floppy_drives=1 +[2026-07-25T10:30:06Z INFO copperline] audio: disabled (null sink); no sound +[2026-07-25T10:30:06Z INFO copperline] emulation timing: deterministic core, paced=false +[2026-07-25T10:30:06Z INFO copperline::emulator] filesys: services board on the Zorro chain (slot 0), 1 mount(s) +[2026-07-25T10:30:06Z INFO copperline::emulator] extended ROM: /opt/homebrew/share/copperline/aros/aros-amiga-m68k-ext.bin at 0xE00000 +[2026-07-25T10:30:06Z INFO copperline::emulator] input: port 1 = mouse, port 2 = joystick +[2026-07-25T10:30:06Z INFO copperline::emulator] machine profile: A500 (gate array None, rtc none) +[2026-07-25T10:30:06Z INFO copperline::emulator] real pacing budget: returned m68k cycles plus explicit chip-bus waits +[2026-07-25T10:30:06Z INFO copperline::zorro] zorro II board "Copperline" autoconfigured at 0x00E90000 +[2026-07-25T10:30:06Z INFO copperline::zorro] zorro II board "Copperline services" autoconfigured at 0x00EA0000 +[2026-07-25T10:30:07Z INFO copperline::bus::custom_regs] BPLCON3 write 0x0C00 dropped (OCS Denise); further drops not logged +[2026-07-25T10:30:15Z INFO copperline] benchmark: ran 40.012s emulated to 40.000s target in 8.833s wall, 1999 frames (226.3/s) +[2026-07-25T10:30:15Z INFO copperline] benchmark frame times: p50=3.40ms p90=4.34ms p99=4.90ms max=5.62ms +[2026-07-25T10:30:15Z INFO copperline] benchmark frame times: all 2437 frames within the 20ms budget +[2026-07-25T10:30:15Z INFO copperline::emulator] emu stats: 8.8s elapsed, 40.0s emulated (453.0%), 2437 frames (275.9/s), 6548551 slices (741367.7/s), ~0.72 MIPS +[2026-07-25T10:30:15Z INFO copperline::bus] video pipeline stats (emu stats): bitplane_fetch calls=69599142 slots=69599142 rows_started=434995 rows_completed=0 time=0.000ms, sprite_fetch calls=4553384 pair_slots=4553384 lines=2105 time=254.805ms +[2026-07-25T10:30:15Z INFO copperline::bus] video pipeline stats (emu stats): collisions calls=0 pixels=0 full_line_scans=0 control_segments=0 time=0.000ms avg=0.0ns/pixel +[2026-07-25T10:30:15Z INFO copperline::bus] video pipeline stats (emu stats): render frames=0 events=0 control_segments=0 playfield_pixels=0 manual_bpl_segments=0 sprite_lines=0 total=0.000ms phases(events=0.000, background=0.000, playfield=0.000, manual_bpl=0.000, sprites=0.000) diff --git a/docs/copperline-bugreport/REPORT.md b/docs/copperline-bugreport/REPORT.md new file mode 100644 index 0000000..2fff972 --- /dev/null +++ b/docs/copperline-bugreport/REPORT.md @@ -0,0 +1,199 @@ +# Copperline: `[[filesys]]` host-directory boot hangs on 68000/68010 + bundled AROS (regression 0.11.0 → 0.12.0) + +**Status: root-caused and fixed upstream, not yet released** — see +[Resolution](#resolution) below. + +## Summary + +A machine using a `[[filesys]]` host-directory mount as the boot volume +(A500 profile, plain 68000, no explicit ROM → bundled AROS) boots and runs +correctly on Copperline **0.11.0**, but hangs indefinitely on **0.12.0** and +**0.13.0** — AROS never gets past its own boot splash animation, never +reaches the mounted volume, and the guest program never runs. `--serial +stdout` produces no output beyond `romtaginit done`, even after 40 emulated +seconds (about 5x longer than 0.11.0 needs to boot *and* run the guest +program to completion). + +This was found via [AmiAuth](https://github.com/sidick/amiauth)'s on-target +test suite (`tests/copperline/run.sh`, `make copperline-smoke`), which boots +a minimal AmigaOS environment from a host directory to run a native m68k +test binary. CI still pins Copperline 0.11.0 +(`COPPERLINE_VERSION: "0.11.0"` in `.github/workflows/ci.yml`) for unrelated +reasons, which is why this hadn't been noticed before — 0.12.0/0.13.0 were +only tried locally while checking the 0.13.0 release notes for relevant +changes. + +## Environment + +- macOS (Homebrew `copperline` formula) for the 0.13.0 reproduction; the + `Copperline--macos-universal.dmg` release asset for the 0.11.0/0.12.0 + bisection (both run the bundled `copperline` binary inside `Copperline.app` + directly, not the GUI). +- Versions tested: 0.11.0 (works), 0.12.0 (hangs), 0.13.0 (hangs). + +## Config (`machine.toml`) + +```toml +[machine] +profile = "A500" + +[cpu] +model = "68000" + +[memory] +chip = "512K" +slow = "512K" + +[floppy] +drives = 1 + +[[filesys]] +path = "sys" +volume = "AmiAuthTest" +bootpri = 10 + +[emulation] +power_on = true +warp_speed = "max" +``` + +`sys/` is a small host directory: `sys/C/serialtest` (a native m68k +executable) and `sys/S/Startup-Sequence` containing a single line +(`serialtest`) that runs it. No ROM is passed on the command line, so +Copperline boots its bundled AROS Kickstart replacement. + +## Command + +```sh +copperline --config machine.toml --noaudio --serial stdout --benchmark-until 40 +``` + +## Expected (0.11.0 behaviour) + +AROS boots, mounts the `[[filesys]]` host directory as `AmiAuthTest:` +(`bootpri = 10`, outranking the empty floppy), runs +`Startup-Sequence`, `serialtest` executes and emits its results over serial +via `exec/RawPutChar`, then the emulator exits at the `--benchmark-until` +deadline. Total wall-clock: **~8.8s**. + +Full serial capture (`0.11.0-serial.log`): + +``` +[...ROM/autoconfig boot log...] +romtaginit +romtaginit done +BEGIN +HOTP0=755224 +HOTP1=287082 +HOTP2=359152 +HOTP3=969429 +HOTP4=338314 +HOTP5=254676 +HOTP6=287922 +HOTP7=162583 +HOTP8=399871 +HOTP9=520489 +DRBG=be491355307bb821bf72d7f115d91156 +END +``` + +## Actual (0.12.0 and 0.13.0 behaviour) + +Boot log is **byte-identical** up through `romtaginit done`, then nothing +further is ever emitted. The process runs the full 40 emulated seconds +(wall clock also ~8.8s — `warp_speed = "max"`, so wall time doesn't grow +even though it never finishes booting) and exits without the guest program +ever running. + +Full serial capture (`0.12.0-serial.log` / `0.13.0-serial.log`, identical): + +``` +[...ROM/autoconfig boot log...] +romtaginit +romtaginit done +``` +(nothing else — no BEGIN, no HOTP vectors, no END) + +A `--screenshot-after 39` at the very end of the 40s window +(`0.13.0-boot-stuck.png`, attached) shows AROS still animating its own boot +logo ("AROS" wordmark + eyes) — alive and rendering, not crashed, just stuck +before ever reaching a state where it looks at the mounted volume. + +## Isolation + +- Removing `[floppy] drives = 1` (leaving only `[[filesys]]`) does not + change the outcome — still hangs on 0.12.0. So the floppy section isn't + the trigger. +- Substituting a real, licensed Kickstart 2.04 ROM (512 KiB) for the + bundled AROS still hangs — with the real ROM the guest doesn't even + render its own "Insert disk" boot screen (0 bitplane fetches at 8s + emulated per the `emu stats` log line), vs. a plain `[machine] profile = + "A500"` config with **no** `[[filesys]]` section, which renders the + normal Kickstart 2.0 splash screen correctly and promptly. So the trigger + is `[[filesys]]` itself, independent of ROM choice (bundled AROS vs. real + Kickstart) and independent of the floppy section. +- This lines up with the 0.12.0 release notes' description of `[[filesys]]` + changing from a discard-on-exit RAM snapshot to a live host-directory + pass-through (`.uaem` sidecar files for protection bits/comments/ + datestamps, new `readonly` flag to opt back into the old behaviour) — + that refactor is the most likely place this regressed, though I haven't + bisected inside the 0.12.0 development history itself. + +## Files in this report + +- `0.11.0-serial.log`, `0.12.0-serial.log`, `0.13.0-serial.log` — full + stdout (serial) capture for each version, identical config/command. +- `0.11.0-stderr.log`, `0.12.0-stderr.log`, `0.13.0-stderr.log` — matching + stderr (Copperline's own log output) for each run. +- `0.13.0-boot-stuck.png` — screenshot at 39s emulated time under 0.13.0, + showing AROS still on its own boot animation, never having reached the + mounted filesystem. + +## Suggested next steps (for the Copperline maintainer) + +1. Reproduce with the config above (bundled AROS needs no ROM asset). +2. `git bisect` between the 0.11.0 and 0.12.0 tags, most likely inside + whatever commit(s) reworked `[[filesys]]` from a RAM-snapshot mount to + the live host-directory pass-through (see "Isolation" above). +3. Check whether the new `.uaem`-sidecar / live-write-back machinery is + blocking on something during volume validation/mount (a lock, an fsync, + a synchronous host filesystem call) that never returns during + AmigaDOS's disk-change / DOS-list probing, which would explain "stuck + before ever reaching the mounted volume" rather than a crash. + +## Resolution + +Root cause found and fixed upstream: [CopperlineHQ/Copperline#312](https://github.com/CopperlineHQ/Copperline/pull/312) +(open, not yet in a release as of 0.13.0). + +The hang is **CPU-model-specific to 68000/68010**, not the `[[filesys]]` +machinery itself. `FilesysBoard::write()` only fired the `DIAG_DOORBELL` +(and `REG_DOSPKT`/`REG_MSGPORT`) MMIO doorbell on a single 32-bit access. +A 68020+'s 32-bit data bus satisfies that in one write, but a 68000/68010 +has a 16-bit external bus, so the core's `write_move_dest_68000` correctly +splits every `move.l` destination write into two word bus cycles — real +hardware behaviour. The doorbell guard never saw the `size == 4` case on +those CPUs, so the guest ROM's `move.l a0,DIAG_DOORBELL(a0)` in the +DiagPoint stub never reached `FilesysBoard::diag_entry`, expansion init +never ran, and the guest hung forever waiting on a host filesystem that +never mounted. A regression from commit `497845c`, which switched the +services board from a size-independent A-line HLE trap to plain MMIO +registers. Confirmed independent of ROM choice (bundled AROS or a real +Kickstart, matching the "Isolation" section above) and of `[machine] +profile` — reproduced identically on 0.13.0 with both the A500/68000 +config above and the real-ROM `pbkdf2-bench` config. + +**68020+ is not affected** — its 32-bit bus never splits the write, so +`[[filesys]]` boots normally regardless of Copperline version. Confirmed +locally (2026-07-28): the A500/68000 config above hangs identically on +brew 0.13.0; switching only `[cpu] model` to `"68020"` boots to completion +in the same config. A local build of Copperline off the `#312` branch also +boots the unmodified 68000 config to completion, confirming the fix. + +AmiAuth's own tests (`tests/copperline/run.sh`, `tests/copperline/bench.sh`) +stay on 68000 rather than adopting the 68020 workaround, since the whole +point of those tests is validating real 68000/68010 bus-cycle behaviour +(this bug is a good example of why: it's real hardware-accurate 68000 +behaviour in the CPU core that the filesys board's doorbell logic didn't +handle). They instead support a `COPPERLINE=` env var to point at a fixed +build until a release ships `#312`. diff --git a/tests/copperline/README.md b/tests/copperline/README.md index d0881d6..f698bdc 100644 --- a/tests/copperline/README.md +++ b/tests/copperline/README.md @@ -46,10 +46,21 @@ Kickstart). CI is currently pinned to Copperline **0.11.0** (`COPPERLINE_VERSION` in `ci.yml`); this project's day-to-day local/interactive Copperline use has -since moved to **0.12.0** (Homebrew) for the features noted below. Nothing in -*this* test needs 0.12 — worth bumping the CI pin at some point mainly to stay -current and to pick up 0.12's faster AROS boot, not because anything here is -broken on 0.11. +since moved to **0.12.0/0.13.0** (Homebrew) for the features noted below. +Nothing in *this* test needs 0.12+ — worth bumping the CI pin at some point +mainly to stay current, not because anything here is broken on 0.11. + +Bumping past 0.11.0 is currently blocked by a real bug, though: any +`[[filesys]]` host-directory mount hangs the boot forever on a 68000/68010 +guest under released 0.12.0/0.13.0 — see +[`docs/copperline-bugreport/REPORT.md`](../../docs/copperline-bugreport/REPORT.md). +Root-caused and fixed upstream +([CopperlineHQ/Copperline#312](https://github.com/CopperlineHQ/Copperline/pull/312)), +not yet in a release. `run.sh` and `bench.sh` support a `COPPERLINE=` env var +to point at a build off that branch in the meantime — keep `[cpu] model = +"68000"` rather than working around the bug by raising the CPU model, since +these tests exist specifically to validate real 68000/68010 behaviour (and, +for `bench.sh`, real 68000 KDF-throughput numbers). ## Files diff --git a/tests/copperline/bench.sh b/tests/copperline/bench.sh index 8452b8f..12f1406 100755 --- a/tests/copperline/bench.sh +++ b/tests/copperline/bench.sh @@ -2,23 +2,36 @@ # bench.sh — measure PBKDF2-HMAC-SHA1 throughput on a stock 68000 under # Copperline, to inform the vault KDF iteration policy (see docs/SECURITY.md). # -# Needs copperline, docker (the amiga-gcc image), and a 512 KiB Kickstart ROM -# (timer.device EClock is not available under the bundled AROS, so this one dev -# tool needs a real ROM — override with KICK=). Invoked by `make pbkdf2-bench`. +# Needs copperline (or COPPERLINE= pointing at another build — see run.sh's +# header for why you might need one), docker (the amiga-gcc image), and a +# 512 KiB Kickstart ROM (timer.device EClock is not available under the +# bundled AROS, so this one dev tool needs a real ROM — override with +# KICK=). Invoked by `make pbkdf2-bench`. +# +# NOTE: [[filesys]] hangs after boot on a 68000/68010 guest under released +# Copperline 0.12.0/0.13.0 (split move.l bus writes never ring the hostfs +# doorbell) — see docs/copperline-bugreport/REPORT.md. Fixed upstream in +# CopperlineHQ/Copperline#312, not yet released — until it is, point +# COPPERLINE= at a build off that branch rather than raising the CPU model +# below, which would invalidate these numbers as 68000 KDF calibration data. set -eu HERE=$(cd "$(dirname "$0")" && pwd) ROOT=$(cd "$HERE/../.." && pwd) +COPPERLINE=${COPPERLINE:-copperline} KICK=${KICK:-/Users/simond/Documents/Amiberry/Roms/amiga-os-310-a600.rom} IMG=${AMIGA_GCC_IMAGE:-stefanreinauer/amiga-gcc:latest} [ -e "$KICK" ] || { echo "FAIL: need a Kickstart ROM (set KICK=)" >&2; exit 2; } -command -v copperline >/dev/null || { echo "FAIL: copperline not on PATH" >&2; exit 2; } +command -v "$COPPERLINE" >/dev/null || { echo "FAIL: $COPPERLINE not found" >&2; exit 2; } -# Build the bench binary (m68k, -O2 as production). +# Build the bench binary (m68k, -O2 as production). hmac.c defines the +# SHA-256/512 HMAC variants unconditionally, so sha256.c/sha512.c must link +# even though this benchmark only exercises the SHA-1 path. docker run --rm --platform linux/amd64 -v "$ROOT":/work -w /work "$IMG" sh -lc \ 'PATH=/opt/amiga/bin:$PATH m68k-amigaos-gcc -std=c99 -O2 -Wall -m68000 -noixemul \ -Isrc/core src/core/pbkdf2.c src/core/hmac.c src/core/sha1.c \ + src/core/sha256.c src/core/sha512.c \ tests/copperline/pbkdf2bench.c -o build/pbkdf2bench' T=$(mktemp -d) @@ -45,7 +58,7 @@ bootpri = 10 warp_speed = "max" EOF -copperline --config "$T/m.toml" --noaudio --serial stdout --benchmark-until 200 "$KICK" \ +"$COPPERLINE" --config "$T/m.toml" --noaudio --serial stdout --benchmark-until 200 "$KICK" \ >"$OUT" 2>/dev/null || true line=$(tr -d '\r' <"$OUT" | grep '^PBKDF2 ' | head -1 || true) [ -n "$line" ] || { echo "FAIL: no PBKDF2 result (boot/timer issue)" >&2; exit 1; } diff --git a/tests/copperline/machine.toml b/tests/copperline/machine.toml index 8cb3ce2..b86fd59 100644 --- a/tests/copperline/machine.toml +++ b/tests/copperline/machine.toml @@ -6,10 +6,17 @@ # The Kickstart ROM is passed as a positional CLI arg (which overrides `rom` # here), so this file stays portable across machines. See ../../Makefile # `copperline-smoke` and ./run.sh. - -[machine] -profile = "A500" - +# +# NOTE: any [[filesys]] host-directory mount hangs forever after +# "romtaginit done" on this 68000 CPU under released Copperline +# 0.12.0/0.13.0 (bundled AROS or a real ROM alike) — see +# docs/copperline-bugreport/REPORT.md. Root cause: the services board's +# MMIO doorbells only fired on a single 32-bit write, but a 68000/68010's +# 16-bit bus splits every move.l into two word writes, so the doorbell +# never rang and expansion init never ran. Fixed upstream in +# CopperlineHQ/Copperline#312 (not yet released as of 0.13.0) — until a +# release ships it, point COPPERLINE= (see ./run.sh) at a build off that +# branch instead of downgrading this config's CPU. [cpu] model = "68000" diff --git a/tests/copperline/run.sh b/tests/copperline/run.sh index 4e55bb0..ed51e8a 100755 --- a/tests/copperline/run.sh +++ b/tests/copperline/run.sh @@ -10,7 +10,12 @@ # debug path straight to the Paula serial registers. # # Prereqs: -# - copperline on PATH (brew install copperline) +# - copperline on PATH (brew install copperline), or COPPERLINE= pointing +# at another build (e.g. a local build of CopperlineHQ/Copperline#312, +# which fixes the [[filesys]]-hangs-on-68000 bug described in +# docs/copperline-bugreport/REPORT.md — not yet in a release). Such a +# build won't have the bundled AROS assets installed next to it, so pair +# COPPERLINE= with KICK= (a real ROM) when using one. # - the cross-built harness SERIALTEST_M68K= (default build/serialtest) # - KICK= (optional): a 512 KiB Kickstart ROM. If unset, boots Copperline's # bundled AROS Kickstart replacement — redistributable, so CI needs no ROM. @@ -19,6 +24,7 @@ set -eu HERE=$(cd "$(dirname "$0")" && pwd) ROOT=$(cd "$HERE/../.." && pwd) +COPPERLINE=${COPPERLINE:-copperline} KICK=${KICK:-} # empty => bundled AROS (no licensed ROM needed) BIN=${SERIALTEST_M68K:-$ROOT/build/serialtest} BENCH=${BENCH:-40} # emulated seconds to run; enough for the slower AROS boot @@ -28,7 +34,7 @@ VECTORS="0=755224 1=287082 2=359152 3=969429 4=338314 5=254676 6=287922 7=162583 [ -e "$BIN" ] || { echo "FAIL: missing $BIN" >&2; exit 2; } [ -z "$KICK" ] || [ -e "$KICK" ] || { echo "FAIL: KICK set but missing: $KICK" >&2; exit 2; } -command -v copperline >/dev/null || { echo "FAIL: copperline not on PATH" >&2; exit 2; } +command -v "$COPPERLINE" >/dev/null || { echo "FAIL: $COPPERLINE not found" >&2; exit 2; } [ -n "$KICK" ] && echo "ROM: $KICK" || echo "ROM: bundled AROS" # --- stage the boot volume (just the harness binary) ------------------------- @@ -46,8 +52,8 @@ trap cleanup EXIT INT TERM # config's (absent) rom; with none, Copperline boots its bundled AROS. set -- --config machine.toml --noaudio --serial stdout --benchmark-until "$BENCH" [ -n "$KICK" ] && set -- "$@" "$KICK" -( cd "$HERE" && copperline "$@" ) >"$OUT" 2>/dev/null \ - || { echo "FAIL: copperline exited non-zero" >&2; cat "$OUT" >&2; exit 3; } +( cd "$HERE" && "$COPPERLINE" "$@" ) >"$OUT" 2>/dev/null \ + || { echo "FAIL: $COPPERLINE exited non-zero" >&2; cat "$OUT" >&2; exit 3; } tr -d '\r' <"$OUT" >"$OUT.n" && mv "$OUT.n" "$OUT" # serial sends CRLF; drop CR echo "----- serial capture -----"; cat "$OUT"; echo "--------------------------"