Skip to content

scsi: targets any controller can open, with the machine's identity - #265

Merged
techomancer merged 1 commit into
techomancer:mainfrom
atomchild411:scsi-identity
Oct 21, 2026
Merged

techomancer merged 1 commit into
techomancer:mainfrom
atomchild411:scsi-identity

Conversation

@atomchild411

Copy link
Copy Markdown
Collaborator

scsi: targets any controller can open, with the machine's identity

Groundwork for a second SCSI host adapter (the O2's AIC-7880), with no change to what the Indy or Indigo2 report.

The change

  • ScsiDevice::open: the code that opens a target (a CHD, a copy-on-write overlay, the file itself, or an empty CD-ROM drive) moves out of wd33c93a::add_device, so any controller can attach the same targets.
  • ScsiIdentity: what a target reports in INQUIRY (vendor, product, revision) is passed in by the controller. The Indy and Indigo2 keep exactly what they reported before, the Sony CDU-76S and the SGI disk strings, now defined beside wd33c93a.
  • Commands the shared device now answers: RESERVE(6), RELEASE(6), VERIFY(10) and SET CD SPEED (nothing to do, so GOOD), and MODE SELECT(10), with 512-, 1024- and 2048-byte block lengths accepted.
  • Write errors carry sense instead of a bare check condition: a write to a CD-ROM is DATA PROTECT / write protected, a write past the end is ILLEGAL REQUEST / LBA out of range (and no longer grows the image), and a backend error is MEDIUM ERROR.

Tests

  • cargo test --lib: all pass, apart from breakpoints_can_be_set_while_running_and_report_their_hit and udp_fragmented_both_ways, which fail the same way on main here. Built in the three CI configurations.
  • Booted windowed on an Indy (Newport), an Indigo2 IP22 (XZ, both SCSI controllers) and an Indigo2 IP28 (Solid IMPACT): hinv lists the same disk and CD-ROM as before, then a disk read, a 10 MB write + sync, the CD mounted by mediad, audio, network, X and a keyboard login, and a clean shutdown.
  • Earlier on the same change: an ISO 9660 CD mounts and reads back byte-identical on the Indy and Indigo2.

🤖 Generated with Claude Code

The code that opens a target -- a CHD, a copy-on-write overlay, the file
itself, or an empty CD-ROM drive -- lived inside wd33c93a; it is
ScsiDevice::open now. What a target reports in INQUIRY is the attaching
controller's ScsiIdentity: the Indy keeps its Sony CDU-76S and SGI disk,
defined beside wd33c93a, and the command set stays shared.

The shared device also answers RESERVE, RELEASE, VERIFY and SET CD SPEED
(nothing to do), takes MODE SELECT(10) and a 1024-byte block length, and
says why a write failed (write protected, block out of range, medium
error) instead of returning a check condition with no sense; a write past
the end is refused rather than growing the image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@techomancer
techomancer merged commit 18ecf48 into techomancer:main Oct 21, 2026
7 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.

2 participants