Re: [hatari-devel] ACSI: READ/WRITE (10) incorrectly evaluate block number

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


Am Sat, 26 Oct 2013 08:21:17 +0200
schrieb Uwe Seimet <Uwe.Seimet@xxxxxxxxx>:

> Hi Thomas,
> 
> > No, I think the problem is something else - as far as I understand
> > that code, HDC_GetOffset is supposed to return the offset in bytes
> > - that's why it shifts the value by 9 bit, it "multiplies" it with
> > the sector size of 512.
> > 
> > I think you rather run into integer overflow problems here.
> > nLastBlockAddr is only a 32-bit value, and fseek also does not
> > support big files ... so you certainly run into problems when your
> > HD image is bigger than 2 GB. Did you also tried with images > 1 GB
> > but < 2 GB? I'd expect that at least all images < 2 GB would work.
> 
> I see your point with the 9 bit shift, but I stumbled upon this
> problem when reading the root sector of an image < 1 GB. I read the
> root sector with READ (6) and READ (10) and compared the returned
> data. They differed, but only when reading data from ACSI. When
> reading from an emulated IDE drive and a real ACSI bus everything is
> fine, so I don't think my testing code is wrong.

Hm, but root sector has address 0, right? So the shift should not
matter anyway. Could you maybe HDC_VERBOSE and HDC_REALLY_VERBOSE in
hdc.c and send me the output that corresponds to the two read commands?

> > Anyway, if I find some spare time at the weekend, I'll try to clean
> > up that mess, e.g. by using fseeko() instead of fseek()
> > everywhere...

Ok, code now uses fseeko() and I tried to avoid truncation of the
offset, so if this was part of the problem, it should hopefully be
fixed now.

> By the way, the Additional Length field returned by INQUIRY is still
> 26, i. e. less than 31, even though 31 is the minimum number mandated
> by the standard. The total minimum number of bytes INQUIRY should
> return is 36, which means Additional Length should be at least 31. If
> I counted correctly currently the actual number of bytes returned are
> 38, by the way. If it supposed to stay this way Additional Length
> would have to be 33.

Yes, right, that was still on my todo list ... I fixed that now, too.

> There are also other problems, see the "Atari ACSI (ICD") section in
> the attached logfile, compared with the "Atari IDE" section. When
> running the same test again there are even more errors, e. g. the
> device name is garbled, and I have to restart (not just reset) Hatari
> in order to get a meaningful result again. I guess memory is
> overwritten somewhere.

Sounds interesting ... is that test program available for download
somewhere?

 Thomas



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