Skip to content

atapibasedevice: Clear BSY and signal interrupt on unsupported ATA command - #206

Merged
dingusdev merged 2 commits into
dingusdev:masterfrom
probonopd:fix-atapi-cdrom-boot-hang
Aug 8, 2026
Merged

dingusdev merged 2 commits into
dingusdev:masterfrom
probonopd:fix-atapi-cdrom-boot-hang

Conversation

@probonopd

Copy link
Copy Markdown
Contributor

Summary

The ATAPI CD-ROM hung Open Firmware during device probing on the Power Mac G3 beige, leaving a grey screen with a cursor after the 3rd display extension init.

Root cause

AtapiBaseDevice::perform_command() default case set the ABRT/ERR bits but left BSY asserted and never fired the interrupt. When Open Firmware issued an unsupported ATA command during its boot device probe (0xEC IDENTIFY_DEVICE), the device stayed busy forever and the machine never progressed past probing the CD-ROM.

Changes

  1. atapibasedevice.cpp - On unsupported ATA command, clear BSY and call update_intrq(1) so the host receives a proper error status and can continue, matching the other command paths and the behavior in AtaHardDisk.
  2. scsicdromcmds - Move the Apple Features MODE_SENSE page 0x31 getter from ScsiCdrom into ScsiCdromCmds so it is registered for the ATAPI CD-ROM as well as the SCSI one. The Mac OS driver requests this page on device errors; the ATAPI path previously replied "page not supported".

Verification

Booting Mac OS 9.2.2 from the install CD on the Power Mac G3 beige with a 256 MB RAM bank now proceeds past the point where it previously hung. No compiler warnings.

@dingusdev

dingusdev commented Aug 8, 2026 •

Copy link
Copy Markdown
Owner

Looks good. My only say about this is that the two changes should be separate commits.

…mmand

The default case in perform_command() set the ABRT/ERR flags but left BSY
asserted and never fired the interrupt. Open Firmware therefore hung
waiting on the ATAPI CD-ROM after issuing commands it does not support
(e.g. 0xEC IDENTIFY_DEVICE during the boot device probe).
Move the Page 0x31 getter from ScsiCdrom into ScsiCdromCmds so it is also
registered for the ATAPI CD-ROM, which Mac OS queries via MODE_SENSE.
@probonopd
probonopd force-pushed the fix-atapi-cdrom-boot-hang branch from 664a797 to 3f1f2d7 Compare August 8, 2026 21:31
@probonopd

Copy link
Copy Markdown
Contributor Author

Split into two commits as requested: 247d5ca (atapibasedevice BSY/interrupt fix) and 3f1f2d7 (scsicdrom page 0x31 move to ScsiCdromCmds). Thanks for the review!

@dingusdev
dingusdev merged commit ed94cd2 into dingusdev:master Aug 8, 2026
@probonopd

Copy link
Copy Markdown
Contributor Author

That was quick. Thanks!

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