FDF Image
From Just Solve the File Format Problem
(Difference between revisions)
Arnoudmulder (Talk | contribs) (→Specifications) |
Arnoudmulder (Talk | contribs) (file format layout) |
||
| Line 19: | Line 19: | ||
Basically FDF used RLE compression. | 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. | ||
| + | |||
| + | //------------------------------------------------------------------------------ | ||
| + | // File header | ||
| + | //------------------------------------------------------------------------------ | ||
| + | |||
| + | // file signature | ||
| + | #define FDFFILE_SIGNATURE MAKE_FOURCC(0x1A, 'F', 'D', 'F') | ||
| + | |||
| + | // file header | ||
| + | // - 128 bytes | ||
| + | typedef struct | ||
| + | { | ||
| + | // equal to FDFFILE_SIGNATURE | ||
| + | UINT32 Signature; | ||
| + | |||
| + | // unknown (0x0600) | ||
| + | UINT16 Unknown1; | ||
| + | |||
| + | // description | ||
| + | CHAR Descr[FDFFILE_LEN_DESCR]; | ||
| + | |||
| + | // all zero | ||
| + | BYTE Reserved1[8]; | ||
| + | |||
| + | // unknown (0x0100) | ||
| + | UINT16 Unknown2; | ||
| + | |||
| + | // unknown (0x0034) | ||
| + | UINT16 Unknown3; | ||
| + | |||
| + | // all zero | ||
| + | BYTE Reserved2[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 */ | ||
| + | |||
| + | // default block size is 9216 bytes | ||
| + | #define FDFFILE_DEFAULT_BLKSIZE (9*SIZE_KB) | ||
| + | |||
| + | |||
| + | // 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 its end of data | ||
| + | // - if FDFFILE_METHOD_STORED then remainder is stored uncompressed | ||
| + | // - Otherwise: | ||
| + | // * 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 | ||
| + | //------------------------------------------------------------------------------ | ||
| + | // - decompressed blocks do not need to be the same size as stored blocks | ||
| + | // (stored blocks are FDFFILE_DEFAULT_BLKSIZE in size) | ||
| + | //------------------------------------------------------------------------------ | ||
==Software== | ==Software== | ||
Revision as of 20:56, 21 September 2026
Contents |
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.
File Identification
FDF files have the header "1A 46 44 46".
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.
//------------------------------------------------------------------------------
// File header
//------------------------------------------------------------------------------
// file signature
#define FDFFILE_SIGNATURE MAKE_FOURCC(0x1A, 'F', 'D', 'F')
// file header
// - 128 bytes
typedef struct
{
// equal to FDFFILE_SIGNATURE
UINT32 Signature;
// unknown (0x0600)
UINT16 Unknown1;
// description
CHAR Descr[FDFFILE_LEN_DESCR];
// all zero
BYTE Reserved1[8];
// unknown (0x0100)
UINT16 Unknown2;
// unknown (0x0034)
UINT16 Unknown3;
// all zero
BYTE Reserved2[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 */
// default block size is 9216 bytes
#define FDFFILE_DEFAULT_BLKSIZE (9*SIZE_KB)
// 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 its end of data
// - if FDFFILE_METHOD_STORED then remainder is stored uncompressed
// - Otherwise:
// * 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
//------------------------------------------------------------------------------
// - decompressed blocks do not need to be the same size as stored blocks
// (stored blocks are FDFFILE_DEFAULT_BLKSIZE in size)
//------------------------------------------------------------------------------
Software
Sample File
Links
- EZX's EZ-DisKlone™ Plus for DOS
- SSW/EZX's Super DiskCopy