|Re: [hatari-devel] MODE SENSE patch|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] MODE SENSE patch
- From: Uwe Seimet <Uwe.Seimet@xxxxxxxxx>
- Date: Tue, 15 Mar 2022 21:43:04 +0100
- Authentication-results: strato.com; dkim=none
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1647376984; s=strato-dkim-0002; d=seimet.de; h=In-Reply-To:References:Message-ID:Subject:To:From:Date:Cc:Date:From: Subject:Sender; bh=DRmAGBa4Jspkl9cxm58OCOKgg5Q1C+7dUKnxCUFYZJo=; b=Nv4gwqZ8PBrBlQEyzdgBrQNgMHdfjTzAwzD1kY+ZzF3h4/XrMWZ7np3SyhEqWMjLFP LibAafVaUc9+ObsRGvjL/Tj1Eg55rUd+mnjEFii1YRjSYSRegyOkeys1loO7FgO0jbVb 0juI2s9ga1/NHFHc1KXlcH7kL85ffidxI/r7vjDhVGbAy/kv+Q5v5RFtkN/6WhkSZg+F jBZZvfuVPjds8icyV6P0el6U1YXcLss2J9/fhxxukfmADvNQFURZrKblR7WyiPQWWCX2 Rob1XYEaBDvTj5d1m1ADv8ZquQwxiISuuSSBXyHFxDN1tucmx2u1meKP7L5TsLtPtDY8 1peQ==
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
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?
> 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 ) 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: .
> 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.
> Christian Zietz - CHZ-Soft - czietz@xxxxxxx
> WWW: https://www.chzsoft.de/
> PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA