Skip to content

ide: emulate the A4000 motherboard IDE#185

Merged
LinuxJedi merged 6 commits into
LinuxJedi:mainfrom
codewiz:feat/a4000-ide
Jul 15, 2026
Merged

ide: emulate the A4000 motherboard IDE#185
LinuxJedi merged 6 commits into
LinuxJedi:mainfrom
codewiz:feat/a4000-ide

Conversation

@codewiz

@codewiz codewiz commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Stacked on #184 - the first two commits are that PR; review only the last one
until it merges, after which this diff shrinks to it.

The A4000's IDE port was not emulated at all, so Kickstart spent several seconds
probing for it on every boot and the machine had nothing of its own to boot
from. It is the same ATA cable Gayle drives, so the drives, the task file, and
the command engine move out of gayle.rs into a shared AtaBus (src/ata.rs).
Gayle keeps its ID, interrupt-change, and PCMCIA registers and hands every IDE
register access to the bus; src/ide_a4000.rs is the second front-end. [ide]
now fits drives to an A4000 as well as an A600/A1200.

The decode came out of [debug] log_unmapped rather than guesswork: the ROM's
probe writes the drive/head register at $DD203A and polls status at $DD203E,
which is Gayle's 4-byte stride based at $DD2020. The control block sits one A12
page up at $DD303A.

The part that would not have been guessable: Kickstart's scsi.device polls an
interrupt status register at $DD3020 after every INT2, and with that address
undecoded it spun there - 2.8 million reads in a 45-second boot. It has no
latch; bit 7 just follows the drive's INTRQ, which a status read drops.

Tested by booting an A4000 with an RDB HDF as the IDE master and nothing else to
boot from: it autoboots to Workbench, and the unmapped-access log over the whole
$DD2000-$DD3FFF window is empty. New tests cover the decode, the empty-cable
status float, and the interrupt register.

🤖 Generated with Claude Code

codewiz and others added 2 commits July 14, 2026 22:03
[scsi] controller = "a3000" fits drives to the Super DMAC's WD33C93 instead
of a Zorro board. It is the default on a machine that has one, and it takes no
boot ROM: Kickstart's own scsi.device drives it and autoboots from an RDB disk.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rom_odd is the odd half of a split EPROM dump, so it is meaningless alone and
the config rejects it; clearing the even half left it behind.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds missing emulation for the Amiga A4000 motherboard IDE interface by factoring the existing Gayle IDE implementation into a shared ATA core and introducing an A4000-specific front-end + decode, while also extending config/UI support for onboard (A3000) SCSI vs Zorro SCSI boards.

Changes:

  • Introduces a shared ATA task-file + command engine (AtaBus) and moves IDE drive logic out of gayle.rs into src/ata.rs.
  • Adds an A4000 motherboard IDE front-end (src/ide_a4000.rs) and wires it into bus decode/INT2 behavior, config defaults, and machine construction.
  • Extends SCSI configuration and launcher UI to support the A3000 onboard SCSI controller option (no boot ROM) alongside Zorro SCSI boards.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/video/launcher.rs Updates launcher UI logic for A3000 onboard SCSI selection and IDE availability on A4000.
src/lib.rs Exposes new ata and ide_a4000 modules.
src/ide_a4000.rs Implements A4000 IDE register decode, IRQ status behavior, and unit tests.
src/gayle.rs Refactors Gayle IDE handling to delegate task-file operations to the shared ATA bus.
src/emulator.rs Wires A4000 IDE and A3000 onboard SCSI drive attachment into machine build flow.
src/cpu.rs Routes CPU external accesses to the A4000 IDE device when it decodes the address.
src/config.rs Adds ide_a4000 flag/defaults and extends SCSI controller enum + validation for A3000 onboard SCSI.
src/bus.rs Adds ide_a4000 device to the bus, reset path, LED activity, and INT2 level feeding.
src/ata.rs New shared ATA (IDE) task file + drive model + command engine extracted from Gayle.
copperline.example.toml Updates example configuration docs for A3000 onboard SCSI and A4000 IDE usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ata.rs Outdated
Comment thread src/ide_a4000.rs Outdated
Registers $1A-$1E are not registers and float $FF; $1F is the auxiliary
status, aliased into the file read-only. Both were plain RAM, so cdhooper's
sdmac tool failed its WDC test and reported the chip as not detected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
codewiz and others added 2 commits July 15, 2026 03:52
The front panel only offered an LED to a Gayle machine or an A2091, so an
A3000 (motherboard SCSI) had none -- and neither did any machine whose only
controller was an A4091.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The A4000 has the same ATA cable as Gayle behind a different decode, so the
drives, task file, and command engine move to a shared AtaBus; Gayle keeps its
ID, interrupt, and PCMCIA registers, and the A4000 interface is a second
front-end. [ide] now fits drives to either machine.

Task file at $DD2020 with Gayle stride, control block at $DD303A, and an
interrupt status register at $DD3020 that follows INTRQ -- Kickstart polls it
after every INT2 and spins there if nothing answers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The decode folds the two 16-bit halves of each 4-byte slot together; the old
wording ("either byte of the word") wrongly suggested byte-lane aliasing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LinuxJedi LinuxJedi merged commit c763fa8 into LinuxJedi:main Jul 15, 2026
9 checks passed
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.

3 participants