[hatari-devel] IDE & gemdos HD emulation

Eero Tamminen eerot at users.berlios.de
Tue Jan 19 00:09:31 CET 2010


Hi,

On Monday 18 January 2010, Thomas Huth wrote:
> > E.g. with Cecile booting from IDE drive works, but not when having
> > GEMDOS D & E drives.
>
> I just tried it again, and yes, it works for me. TOS 2.06, IDE
> hard disk image with two partitions and AHDI 6 installed, and one
> GEMDOS hard disk folder "E". Hatari successfully boots from the IDE
> drive and all partitions, C, D and E show up correctly.

Hm.  I got this when trying to format an image with AHDI 6:
	HDC: Unsupported MODE SENSE command

And when AHDI told that it couldn't format the disk image, I got an assert:
hatari: int.c:394: Int_AddRelativeInterruptWithOffset: Assertion `CycleTime 
>= 0' failed.


AHDI 5 can format & partition the disk image fine (dd bs=512 count=16384), 
but only as ACSI.  If I try using --ide-master, ahdi.prg finds the Hatari
IDE, but formatting says "Cannot format unit 0".

If I try to use the ACSI format disk image, everything works fine with that.
If I try same image with --ide-master, HDX or HINSTALL don't even find C:
(after running ahdi.prg, v5 or v6).  And Hatari doesn't boot from HD when
--ide-master is used (when it has AHDI installed on it in --acsi mode).


> > Might be related to ide.c not updating nNumDrives nor nPartitions:
>
> As you can see in gemdos.c, this code is only for old, single-partition
> GEMDOS HD mode ("if (!bMultiPartitions) ...."). For multi-GEMDOS-drive
> mode, this does not apply.

This part applies also to multi partition support:
                         /* If the GemDos Drive letter is free then */
                        if (i >= nPartitions)

And anyway it's strange why IDE should work differently in this respect
from the ASCI HDD?


> > Then I also noticed another thing in ide.c while testing Cecile and
> > getting a lot of ICE bdrv_read() errors (from too short IDE image?):
>
> Is maybe your IDE hard disk image corrupted?

Tried making new one with AHDI as detailed above...


> > ------
> > static void ide_sector_read(IDEState *s)
> > ...
> >
> >                 ret = bdrv_read(s->bs, sector_num, s->io_buffer, n);
> >                 ide_transfer_start(s, s->io_buffer, 512 * n,
> > ide_sector_read);
> >                 ide_set_irq(s);
> >                 ide_set_sector(s, sector_num + n);
> >                 s->nsector -= n;
> >         }
> > }
> > -------
> >
> > bdrv_read() return value errors (ret < 0) aren't handled?
>
> Looks like bad error handling. Feel free to fix it!

Problem is that not being familar with IDE, I'm not sure how it
should be handled. :-)


	- Eero




More information about the hatari-devel mailing list