:: fdchk

iczelia

floppy disk checker for Windows 9x

recent commits

2026-09-04 20:39styleKamila Szewczyk
2026-09-04 20:37v1.0.4Kamila Szewczyk
2026-09-02 09:241.0.3Kamila Szewczyk
2026-08-12 16:50optimised string routinesKamila Szewczyk
2026-08-12 16:45async vxdKamila Szewczyk
2026-08-12 13:41specify gpl3-onlyKamila Szewczyk
2026-08-12 12:10update versionKamila Szewczyk
2026-08-12 12:09ui, readme: hook up and describe new functionalityKamila Szewczyk
2026-08-12 12:04build aux: consistent styleKamila Szewczyk
2026-08-12 12:02scan.c: style, improve messagesKamila Szewczyk

branches

trunk (2026-09-04 20:39)

tags

1.0.4 (2026-09-04 20:39)1.0.3 (2026-09-02 09:24)1.0.2 (2026-08-12 12:10)1.0.1 (2026-05-22 19:05)1.0 (2026-05-21 12:40)
README.md

fdchk

fdchk scans, checks, recovers, formats and defragments FAT12 floppy disks on Windows 95, 98 and Me. It can send commands directly to the floppy controller to test alignment and address marks.

fdchk is licensed under GNU GPL version 3. See LICENSE. Report issues to Kamila Szewczyk <k@iczelia.net>. The project is hosted at <https://github.com/iczelia/fdchk>.

fdchk scanning a floppy disk

Tests

TestEffect
StandardRead every sector and report failures
ThoroughWrite and check four patterns, then restore each sector
DiagnosticTest seeks, alignment and sector IDs through fdchk.vxd
Check filesystemFind FAT12 cross-links, lost chains, cycles and size errors

The standard test reads every sector. It writes only when automatic bad-cluster marking is enabled. In that case, fdchk marks each new bad cluster as 0xFF7 in both FATs.

The thorough test writes four patterns to each sector and checks each pattern. It then writes the original data back. Removing the disk or losing power before this finishes can damage files.

The diagnostic test shows one cell for each cylinder and head. Grey means good, yellow means being tested, orange means wrong cylinder, purple means no address mark, and red means another read error. The VxD writes the full ST0/ST1/ST2/C/H/R/N result in fdchk-diag.log.

The filesystem check reads the boot sector, both FATs and every directory. It reports errors but does not write to the disk.

Disk operations

File recovery copies every file it can read. It writes zeros where file data cannot be read and writes details to fdchk-recovery.log.

Quick format writes a new boot sector, FATs and root directory. Full format first formats and checks every track, including its sector IDs, address marks and CRCs. It sends format commands through the DOS block driver or directly to the FDC.

Defragmentation moves files and directories to lower cluster numbers. It works through subdirectories and sorts each directory by name. It then writes zeros to every free cluster. Batch mode asks for another disk after each scan. The log viewer reads files from <program-directory>\logs.

Building

The release build needs i686-w64-mingw32-gcc and nasm. mtools is needed only for the floppy image.

make
make floppy
make debug
make clean

make builds fdchk.exe and its embedded fdchk.vxd. make floppy creates a 1.44 MB FAT12 image containing the executable. The debug build uses the C runtime and retains symbols.

tab: 248 wrap: offon