Re: [hatari-devel] MODE SENSE patch

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


Hi Christian,

Obviously you are familiar with some rather exotic DISKUS functionality :-):

I stumbled upon the missing MODE SENSE support for 0x3f when extending my
SCSI Driver tests, but these tests do not request individual pages. This is
why I did not look into the details of the existing code for a single page.
On first sight I agree with what you say. To fix this one can probably just
call HDC_CmdModeSense0x04 with an offset of 4, similar to how I did it for
0x3f.

The current code also does not check the DBD field, which means that more
changes would be required in order to be compatible at least with SCSI-2.
On the other hand, Hatari claims to be compatible with SCSI-1 CCS, for which
I don't have a reliable specification. But from my experience with real
SCSI-1 drives there is hardly any difference compared to SCSI-2.

But before applying more changes I would like to learn more on how to
reproduce what Eero reported:

HDC: REQUEST SENSE (SCSI, t=0, lun=0, cdb=03:00:00:00:60:00).
WARN : HDC: *** Strange REQUEST SENSE ***!

@Eero Can you please provide instructions on how to reproduce this, and the
Hatari commit ID that is affected?

Best regards

Uwe

> Uwe Seimet schrieb:
> 
> > The attached patch improves MODE SENSE a bit, by at least returning one
> > page instead of none when all are requested.
> 
> Even with this patch, I'm confused by the MODE SENSE return data. Maybe
> Uwe (or someone else) can help resolve my confusion.
> 
> I would expect the MODE SENSE data *always* to start with a four-byte
> header, containing: the overall data length, the medium type, a write
> protect bit and the length of the block descriptors (if any). Only after
> this header the individual pages should be returned.
> 
> This is indeed the case when requesting page 0x3F (=all pages); see
> screenshots grab0005 and grab0006. At least the overall length appears
> to be set in the header (by [1]) and page 4 data starts only after the
> header at offset 4, followed by page 0 data.
> 
> However, when I request only page 4 (screenshots grab0003 and grab0004)
> the four-byte header is missing and the page 4 data starts of offset 0.
> This matches what I see in the Hatari codebase: [2].
> 
> Is my understanding of the SCSI standard(s) so wrong, w.r.t. MODE SENSE?
> Actual SCSI devices that I checked *always* return that header.
> 
> Regards
> Christian
> 
> [1]
> https://git.tuxfamily.org/hatari/hatari.git/tree/src/hdc.c?id=c895a8b5f0f5637bc0ed8e7f17633823558953bd#n411
> [2]
> https://git.tuxfamily.org/hatari/hatari.git/tree/src/hdc.c?id=c895a8b5f0f5637bc0ed8e7f17633823558953bd#n399
> --
> Christian Zietz  -  CHZ-Soft  -  czietz@xxxxxxx
> WWW: https://www.chzsoft.de/
> PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA








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