[Coco] XRoar and Color

Ciaran Anscomb cocomalt at 6809.org.uk
Fri Apr 5 03:19:35 EDT 2024


Allen Huffman wrote:
> Speaking of IDE … are there docs on the IDE file format you use? It
> would be nice to have a converter that lets me take any of the existing
> hard drive images and use them under XRoar.

Hmm not really.  The code was contributed by Alan Cox, his repo for it
being here:

https://github.com/EtchedPixels/IDE.git

makedisk.c in there might be useful for you.

Basically, the format is:

512 bytes of header, the only relevant part of which is that it starts
"1DED15C0".

512 bytes of IDENTIFY DEVICE data, as 256 * 16-bit wrong-endian words.
Documented in the ATAPI spec, but only _really_ early ones!  I found
"AT Attachment with Packet Interface Extension - (ATA/ATAPI-4)", ANSI
X3.****-199x (so, a draft) seems good - the table is in section 8.12.

IIRC, later versions of the spec don't mention the CHS data at words
1, 3 and 6.  Those, together with the "capabilities" flags in word 49
are the only parts the code reference, though when creating an image,
it fills in various string data too, giving devices amusing names.

However, you don't really need to worry about any of that any more, as I
abstracted out "block device" access a bit.  So long as you're treating
it as an IDE LBA drive, you can just have a raw dump of 512 byte sectors.
Call the file something.img and really it should Just Work.

For completeness:

A .ide file is expected to have headers as described, 512 bytes per sector.

A .img file is expected to be headerless and have 512 bytes per sector.

A .vhd file is expected to be headerless and have only 256 bytes per sector.

One day I'll implement some basic CoCoSDC support, maybe just enough to be
able to use VHD files in block device mode.  Hasn't happened yet though.

..ciaran


More information about the Coco mailing list