Re: [hatari-devel] Missing DMA sector count register emulation for ACSI transfers?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

What about the SCSI support (ncr5380.c), does that
have the same issue?


	- Eero

If it has, fixing that probably does not help
with m68k Linux SCSI issues as there seem to
be missing SCSI commands[1], but even slight
emulation improvements are always nice...

[1]
DEBUG: raw_scsi: selected id 0
DEBUG: raw_scsi_put_data got message c0 (1/1)
DEBUG: raw_scsi_put_data got message c0 (1 bytes)
DEBUG: raw_scsi: got command byte 1a (1/6)
DEBUG: raw_scsi: got command byte 00 (2/6)
DEBUG: raw_scsi: got command byte 3f (3/6)
DEBUG: raw_scsi: got command byte 00 (4/6)
DEBUG: raw_scsi: got command byte 04 (5/6)
DEBUG: raw_scsi: got command byte 00 (6/6)
TODO : HDC: Unsupported MODE SENSE command
DEBUG: raw_scsi: no data, status = 2
DEBUG: raw_scsi: status byte read 02. Next=1
DEBUG: raw_scsi: message byte read 00. Next=1
DEBUG: raw_scsi: arbitration initiator id 7 (80)
DEBUG: raw_scsi: arbitration
DEBUG: raw_scsi: selected id 0
DEBUG: raw_scsi_put_data got message 80 (1/1)
DEBUG: raw_scsi_put_data got message 80 (1 bytes)
DEBUG: raw_scsi: got command byte 03 (1/6)
DEBUG: raw_scsi: got command byte 00 (2/6)
DEBUG: raw_scsi: got command byte 00 (3/6)
DEBUG: raw_scsi: got command byte 00 (4/6)
DEBUG: raw_scsi: got command byte 60 (5/6)
DEBUG: raw_scsi: got command byte 00 (6/6)
WARN : HDC: *** Strange REQUEST SENSE ***!
DEBUG: raw_scsi: data in 22 bytes waiting
DEBUG: raw_scsi: data in finished, 22 bytes: status phase
DEBUG: DMA initiator recv PC=001839da
DEBUG: SCSI BUS reset
sd 0:0:0:0: Device offlined - not ready after error recovery
sd 0:0:0:0: rejecting I/O to offline device
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 00 1f ff
sd 0:0:0:0: rejecting I/O to offline device
sd 0:0:0:0: [sda] Asking for cache data failed
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: rejecting I/O to offline device
sd 0:0:0:0: rejecting I/O to offline device
sd 0:0:0:0: [sda] Attached SCSI disk
VFS: Cannot open root device "sda" or unknown-block(8,0): error -6


On 1.9.2021 16.45, Christian Zietz wrote:
Hello,

I'm testing a (fairly exotic) harddisk driver that was bundled with DDD
harddisks:

Harddisktreiber V4.13
   (C) 1991 by K.R.
Digital Data Deicke

(Digital Data Deicke used to be a popular Atari distributor in Germany.)

... and I found it not to be working on Hatari. First, I thought that it
was perhaps relying on some non-standard behavior/commands of DDD
harddisks. But meanwhile I've come to the conclusion that there is a
detail missing in Hatari's emulation of ACSI disks.

After completion of a command, the driver reads the DMA status register
at address $FF8606. (Not to be confused with the status byte that is
read over the ACSI bus from the actual drive.) It masks the lower three
bits and checks for 1 (= 3'b001). But Hatari always returns a 3 (=
3'b011), here. Bit 0 means "no DMA error", bit 1 means "sector count
register is not zero". The equivalent lines of code are here:
https://git.tuxfamily.org/hatari/hatari.git/tree/src/fdc.c#n4393

However, it seems that the ACSI code in hdc.c never sets the DMA sector
count register to 0, which makes this particular disk driver fail. I've
tested (by means of a quick hack) that zeroing the sector count register
from Acsi_DmaTransfer() makes Hatari return the expected DMA status of
1, and makes the driver work.

Regards
Christian






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/