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

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


Am Sun, 27 Oct 2013 11:01:48 +0100
schrieb Uwe Seimet <Uwe.Seimet@xxxxxxxxx>:

> Hi Thomas,
> 
> > > As far as I can tell the ACSI emulation code tries to determine
> > > the drive size from the root sector content, which is not
> > > correct. There might have been (old) partitioning software that
> > > once placed the total number of sectors there, but this is not
> > > standardized and also would not help for unpartitioned drives.
> > > I would expect fstat() or something similar to be used in order to
> > > derive the number of blocks from the image file size.
> > 
> > Ok, good hint, thanks, I've fixed this now, too.
> 
> Yes, this works fine now, thank you. Reading beyond the last sector is
> not yet rejected, though.

Oh, well, I (or whoever wrote that code) was assuming that doing
an fseek() beyond the end of the file would return an error ... but it
apparently does not. So I've added now additional checks for correct
sector numbers, so that this problem should now be gone, too.

 Thomas



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