Re: [hatari-devel] Problem with ACSI/DMA: partially solved

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


 Hi Uwe!

Finally, I've got some spare time to look at your bug
reports, and I now fixed most of the issues / applied your patches ...

Am Fri, 11 Oct 2013 23:09:34 +0200
schrieb Uwe Seimet <Uwe.Seimet@xxxxxxxxx>:

> Hi,
> 
> > This behavior has definitely something to do with the ACSI
> > emulation as it only happens when executing certain ACSI commands.
> > Suddenly the whole ACSI emulation appears to be broken and wrong
> > data are returned.
> 
> I have found what caused these problems: The command class check in
> hdc.c is wrong. It says:
> 
> 	if ((HDCCommand.opcode < 0x20 && HDCCommand.byteCount >= 6) ||
> 		(HDCCommand.opcode < 0x40 && HDCCommand.byteCount >= 10))
> 
> This should be
> 
>         if ((HDCCommand.opcode < 0x20 && HDCCommand.byteCount >= 6) ||
>                 (HDCCommand.opcode < 0x60 && HDCCommand.byteCount >= 10))
> 
> because all commands < 0x60 (and not just 0x40) are 10 byte commands.
> (One of the commands I was sending was 0x46.)

You're right, that was really wrong, and I think this also could have
caused the crashes of Hatari that you obsorved since
HDCCommand.byteCount was never set back to zero in that case, so Hatari
kept increasing this counter which finally overflowed the
HDCCommand.command array.

> Additionally, if this condition evaluates to false the status is
> nevertheless set to OK:
> 
> 		HDCCommand.returnCode = HD_STATUS_OK;
> 
> Shouldn't it be HD_STATUS_ERROR in this case, just like with commands
> < 0x20 if they are not actually implemented?

Well, yes and no. That line is ok for commands that have not fully been
received yet (byteCount <= 6 or <= 10), but for unknown opcodes >= 0x60,
it has to be set to the STATUS_ERROR value instead. I added a
corresponding patch, so that problem should hopefully be gone, too, now.

 Thanks again for your bugreports,
  Thomas



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