[hatari-devel] IDE & gemdos HD emulation
Eero Tamminen
eerot at users.berlios.de
Sun Jan 17 00:56:43 CET 2010
Hi,
On Saturday 16 January 2010, Thomas H. wrote:
> > At least although HDDriver claims that driver is installed to the IDE
> > drive, booting with it doesn't run the IDE driver / you don't see the
> > whole driver (Tested both with TT & Falcon modes). I have no idea
> > whether this is Hatari or TOS issue.
>
> Try AHDI 6 or Cecile. With these drivers I was able to boot from IDE
> drive (at least half a year ago).
E.g. with Cecile booting from IDE drive works, but not when having GEMDOS
D & E drives.
Might be related to ide.c not updating nNumDrives nor nPartitions:
$ egrep '(nNumDrives|nPartitions)' *.c
gemdos.c: if ((iDrive <= nNumDrives) && (iDrive > 1))
gemdos.c: i += nPartitions;
gemdos.c: if (i >= nPartitions)
gemdos.c: nNumDrives = i + 3;
gemdos.c: nNumDrives -= 1;
gemdos.c: if ((Drive == 0 && CurrentDrive >= 2) || (Drive >= 3 /*&&
Drive <= nNumDrives*/))
hdc.c:int nPartitions = 0;
hdc.c: nPartitions = 0;
hdc.c: nPartitions++;
hdc.c: nNumDrives += nPartitions;
hdc.c: nNumDrives -= nPartitions;
hdc.c: nPartitions = 0;
tos.c:int nNumDrives = 2; /* Number of drives,...
tos.c: MemorySnapShot_Store(&nNumDrives, sizeof(nNumDrives));
...as GemDOS_InitDrives() uses them:
/* If single partition mode, skip to the right entry */
if (!bMultiPartitions)
i += nPartitions;
...
/* If the GemDos Drive letter is free then */
if (i >= nPartitions)
{
...
nNumDrives = i + 3;
}
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?):
------
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?
- Eero
More information about the hatari-devel
mailing list