FDF Image
From Just Solve the File Format Problem
(Difference between revisions)
Arnoudmulder (Talk | contribs) (source code reference) |
Arnoudmulder (Talk | contribs) m (typo, 80 tracks for 720KB disk) |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 14: | Line 14: | ||
==Specifications== | ==Specifications== | ||
| − | The FDF file format is reverse engineered in 86Box, the source code can be found at | + | The FDF file format is reverse engineered in 86Box, the source code can be found at: |
86Box-master\src\floppy\fdd_img.c | 86Box-master\src\floppy\fdd_img.c | ||
| + | |||
| + | Basically FDF used RLE compression. | ||
| + | |||
| + | Integers are stored as little-endian. | ||
| + | |||
| + | EZ-DisKlone truncates the image, the unused sectors filled with 0xF6 at end of the disk are not stored. | ||
| + | |||
| + | * Each track/head is stored as a block. | ||
| + | * So number of bytes per block is equal to number of bytes per track. | ||
| + | * If two heads then the number of blocks is even. | ||
| + | * The number of stored blocks is equal/less then the number of track/heads. | ||
| + | * The number of stored tracks is in the file header. | ||
| + | * The CHS geometry is derived from the DiskType field. | ||
| + | |||
| + | |||
| + | //------------------------------------------------------------------------------ | ||
| + | // Limits | ||
| + | //------------------------------------------------------------------------------ | ||
| + | |||
| + | // string lengths | ||
| + | #define FDFFILE_LEN_DESCR 64 | ||
| + | |||
| + | // sector size | ||
| + | #define FDFFILE_SECTOR_SIZE 512 | ||
| + | |||
| + | |||
| + | //------------------------------------------------------------------------------ | ||
| + | // File header | ||
| + | //------------------------------------------------------------------------------ | ||
| + | |||
| + | // file signature | ||
| + | #define FDFFILE_SIGNATURE MAKE_FOURCC(0x1A, 'F', 'D', 'F') | ||
| + | |||
| + | // disk (geometry) types | ||
| + | #define FDFFILE_DT_360K 0x03 /* 40/2/9 = 4608 bytes/track */ | ||
| + | #define FDFFILE_DT_720K 0x04 /* 80/2/9 = 4608 bytes/track */ | ||
| + | #define FDFFILE_DT_120M 0x05 /* 80/2/15 = 7680 bytes/track */ | ||
| + | #define FDFFILE_DT_144M 0x06 /* 80/2/18 = 9216 bytes/track */ | ||
| + | |||
| + | |||
| + | // file header | ||
| + | // - 128 bytes | ||
| + | typedef struct | ||
| + | { | ||
| + | // equal to FDFFILE_SIGNATURE | ||
| + | UINT32 Signature; | ||
| + | |||
| + | // always zero | ||
| + | UINT8 Reserved1; | ||
| + | |||
| + | // one of FDFFILE_DT_xxx | ||
| + | UINT8 DiskType; | ||
| + | |||
| + | // description | ||
| + | CHAR Descr[FDFFILE_LEN_DESCR]; | ||
| + | |||
| + | // all zero | ||
| + | UINT8 Reserved2[8]; | ||
| + | |||
| + | // unknown (0x0100) | ||
| + | UINT16 Unknown1; | ||
| + | |||
| + | // number of stored tracks | ||
| + | // - must be multiplied by number of heads to get number of blocks | ||
| + | UINT16 TrackCnt; | ||
| + | |||
| + | // all zero | ||
| + | UINT8 Reserved3[46]; | ||
| + | |||
| + | // | ||
| + | } TFdfFile_FileHdr; | ||
| + | |||
| + | |||
| + | //------------------------------------------------------------------------------ | ||
| + | // Block header | ||
| + | //------------------------------------------------------------------------------ | ||
| + | |||
| + | // block compression method | ||
| + | #define FDFFILE_METHOD_STORED 0x00 | ||
| + | #define FDFFILE_METHOD_RLE 0x01 | ||
| + | #define FDFFILE_METHOD_EOD 0xFF /* end of data */ | ||
| + | |||
| + | |||
| + | // block header | ||
| + | // - 5 bytes | ||
| + | // - followed by RLE compressed data | ||
| + | typedef struct | ||
| + | { | ||
| + | // one of FDFFILE_METHOD_xxx | ||
| + | UINT8 Method; | ||
| + | |||
| + | // CRC16L checksum (LHA) | ||
| + | UINT16 CRC; | ||
| + | |||
| + | // number of compressed bytes | ||
| + | UINT16 Size; | ||
| + | |||
| + | // | ||
| + | } TFdfFile_BlkHdr; | ||
| + | |||
| + | |||
| + | |||
| + | //------------------------------------------------------------------------------ | ||
| + | // RLE compression | ||
| + | //------------------------------------------------------------------------------ | ||
| + | // - if FDFFILE_METHOD_EOD then end of file | ||
| + | // - if FDFFILE_METHOD_STORED then block is stored uncompressed | ||
| + | // - if FDFFILE_METHOD_RLE then: | ||
| + | // * if b7 is set then the lower 7 bits are the repeat count and the next | ||
| + | // byte is the byte to repeat | ||
| + | // * If b7 is zero then its a store count, followed by the stored bytes | ||
| + | //------------------------------------------------------------------------------ | ||
==Software== | ==Software== | ||
* [https://archive.org/details/EZDKP40_ZIP Software download and Emulation] | * [https://archive.org/details/EZDKP40_ZIP Software download and Emulation] | ||
| − | ==Sample | + | ==Sample Files== |
* [https://archive.org/download/UtilitiesRom2/BB_94%20%28G%29.zip/BB_94%20%28G%29%2F1234%2F1234.FDF DOS Mouse Driver Image file] | * [https://archive.org/download/UtilitiesRom2/BB_94%20%28G%29.zip/BB_94%20%28G%29%2F1234%2F1234.FDF DOS Mouse Driver Image file] | ||
| + | * {{DexvertSamples|archive/floppyDiskFile}} | ||
==Links== | ==Links== | ||
* [http://www.ez-forms.com/ezdkp.htm EZX's EZ-DisKlone™ Plus for DOS] | * [http://www.ez-forms.com/ezdkp.htm EZX's EZ-DisKlone™ Plus for DOS] | ||
* SSW/EZX's Super DiskCopy | * SSW/EZX's Super DiskCopy | ||
Latest revision as of 17:31, 22 September 2026
Contents |
[edit] Overview
Floppy Disk File (FDF) are disk images used by the DOS software EZ-DisKlone Plus. Introduced in 1991, the format is a compressed disk image validated by a 16bit CRC.
[edit] File Identification
FDF files have the header "1A 46 44 46".
[edit] Specifications
The FDF file format is reverse engineered in 86Box, the source code can be found at:
86Box-master\src\floppy\fdd_img.c
Basically FDF used RLE compression.
Integers are stored as little-endian.
EZ-DisKlone truncates the image, the unused sectors filled with 0xF6 at end of the disk are not stored.
- Each track/head is stored as a block.
- So number of bytes per block is equal to number of bytes per track.
- If two heads then the number of blocks is even.
- The number of stored blocks is equal/less then the number of track/heads.
- The number of stored tracks is in the file header.
- The CHS geometry is derived from the DiskType field.
//------------------------------------------------------------------------------
// Limits
//------------------------------------------------------------------------------
// string lengths
#define FDFFILE_LEN_DESCR 64
// sector size
#define FDFFILE_SECTOR_SIZE 512
//------------------------------------------------------------------------------
// File header
//------------------------------------------------------------------------------
// file signature
#define FDFFILE_SIGNATURE MAKE_FOURCC(0x1A, 'F', 'D', 'F')
// disk (geometry) types
#define FDFFILE_DT_360K 0x03 /* 40/2/9 = 4608 bytes/track */
#define FDFFILE_DT_720K 0x04 /* 80/2/9 = 4608 bytes/track */
#define FDFFILE_DT_120M 0x05 /* 80/2/15 = 7680 bytes/track */
#define FDFFILE_DT_144M 0x06 /* 80/2/18 = 9216 bytes/track */
// file header
// - 128 bytes
typedef struct
{
// equal to FDFFILE_SIGNATURE
UINT32 Signature;
// always zero
UINT8 Reserved1;
// one of FDFFILE_DT_xxx
UINT8 DiskType;
// description
CHAR Descr[FDFFILE_LEN_DESCR];
// all zero
UINT8 Reserved2[8];
// unknown (0x0100)
UINT16 Unknown1;
// number of stored tracks
// - must be multiplied by number of heads to get number of blocks
UINT16 TrackCnt;
// all zero
UINT8 Reserved3[46];
//
} TFdfFile_FileHdr;
//------------------------------------------------------------------------------
// Block header
//------------------------------------------------------------------------------
// block compression method
#define FDFFILE_METHOD_STORED 0x00
#define FDFFILE_METHOD_RLE 0x01
#define FDFFILE_METHOD_EOD 0xFF /* end of data */
// block header
// - 5 bytes
// - followed by RLE compressed data
typedef struct
{
// one of FDFFILE_METHOD_xxx
UINT8 Method;
// CRC16L checksum (LHA)
UINT16 CRC;
// number of compressed bytes
UINT16 Size;
//
} TFdfFile_BlkHdr;
//------------------------------------------------------------------------------
// RLE compression
//------------------------------------------------------------------------------
// - if FDFFILE_METHOD_EOD then end of file
// - if FDFFILE_METHOD_STORED then block is stored uncompressed
// - if FDFFILE_METHOD_RLE then:
// * if b7 is set then the lower 7 bits are the repeat count and the next
// byte is the byte to repeat
// * If b7 is zero then its a store count, followed by the stored bytes
//------------------------------------------------------------------------------
[edit] Software
[edit] Sample Files
[edit] Links
- EZX's EZ-DisKlone™ Plus for DOS
- SSW/EZX's Super DiskCopy