Image format differences .HFE .IMG .TD0

General discussion forum - for all that doesn't fit in any other category.
Post Reply
somhi
Posts: 3
Joined: Sat Dec 05, 2020 8:15 pm

Image format differences .HFE .IMG .TD0

Post by somhi »

Hello,

I'm doing some research before start preserving my floppy disks. I've read the best image formats are .IMG (from dd utility or so) for normal disks and .TD0 for protected discs. Source: http://www.goodolddays.net/faq/id%2C-5/

I would prefer so save floppies as .IMG as it's an universal format I can mount directly on linux and widely supported by emulators.

Does the .HFE file format offers any remarcable advantages over .IMG, .TD0 file formats ?

Thanks in advance.
Jordi
somhi
Posts: 3
Joined: Sat Dec 05, 2020 8:15 pm

Re: Image format differences .HFE .IMG .TD0

Post by somhi »

Of couse I can use HFE floppy disk dump utility and export to IMG format.
If I had to dump a disk from DOS would it be preferable to use HFE floppy disk dump utility instead of diskcopy utility I suppose but much much slower, so what are the benefits of using HFE disk dump?
Jeff
Site Admin
Posts: 8247
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Image format differences .HFE .IMG .TD0

Post by Jeff »

I don't consider the ".IMG" as a real format : this is just the sectors data without any sector metadata and disk layout information. there is no way to check the data integrity.
td0 : i am not sure about the documentation. probably contains some metadatas.
hfe : store the tracks as they are on the floppy disk : low level encoding, gap, sectors interleaving and track skew, sectors metadata and crc. All is there.
somhi
Posts: 3
Joined: Sat Dec 05, 2020 8:15 pm

Re: Image format differences .HFE .IMG .TD0

Post by somhi »

Thanks Jeff for your answer.

So HFE format seems the most convenient for preserving floppies as they are. The only con I have is the time it takes to dump a disk.

I don't understand though, what would be the benefits of storing all that metadata. For a program/game that does not have any copy protection, does it matter for real use practicity to store it in .IMG or .HFE?
Jeff
Site Admin
Posts: 8247
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Image format differences .HFE .IMG .TD0

Post by Jeff »

somhi wrote: Sun Dec 06, 2020 6:22 pm Thanks Jeff for your answer.

So HFE format seems the most convenient for preserving floppies as they are. The only con I have is the time it takes to dump a disk.

I don't understand though, what would be the benefits of storing all that metadata. For a program/game that does not have any copy protection, does it matter for real use practicity to store it in .IMG or .HFE?
(Almost 4 years later... :wink: )

The issue is that many important parameters are not stored into the IMG/DSK files, and some of them can be important for the access time and the reliability. I am thinking about the sectors interleaving, tracks skew, the different gap size and so on... The software/emulator have to guess the disk layout and these sensitive parameters from the file size, the file extension and sometimes some parameters in the boot sector (when available ... ) ... Not very reliable to be honest and this is even harder when you try to target hundred of different systems...
Some kind of configuration file and/or user intervention are then needed as workaround to fill/fix the missing/ambiguous information.

Definitively all of these information need to stay into the image... This is my point of view.

And also :
Note about HFE images

HFE is a new MFM/FM or GCR encoded floppy file image format. The HFE format keeps intact all the information present on the floppy disks tracks: sectors metadata and data, error detection codes (CRC) and so on. Unlike the older raw data images like IMG, this file format is designed to support most of the existing floppy formats and keep intact all the floppy format metadata. No more guessing or configuration needed to be able to read the images!

From a safety and data integrity point of view, the HFE keep intact and doesn't bypass the original disk controller data integrity checking mechanisms to be able to check that the data loaded from the flash memory media (USB, SDCard...) is valid.

About the older raw data images IMG, please note that no emulator nor software is able to detect a corruption from a raw data image IMG file in a reliable way ! These images don't have any data integrity protection mechanism, and there is no way to properly detect if a sector contains valid data or not. With these kinds of formats, the floppy emulator/software can only encode them on the fly and potentially send the corrupted sector(s) to the machine as "good data". The machine can't detect the error(s) since error detection codes (CRC) are recalculated on the fly by the emulator and this generally leads to undefined behavior and may generate potential serious damage in sensitive applications.

For these reasons, we generally discourage the use of IMG formats without data integrity checking mechanism for industrials and medicals systems and we recommend to use the HFE format or something similar instead.
And even for music and video games applications, it is unfortunately easy to find corrupted images, stated as "good" today, due to, for example, a past flash issue, a copy/write issue to the sdcard/usb stick and so on...
https://hxc2001.com/floppy_drive_emulat ... ORMAT_NOTE
Post Reply