Description
Currently mkfs.fat.c
defines:
#define FAT_EOF (atari_format ? 0x0fffffff : 0x0ffffff8)
and fsck.fat.h
defines:
#define FAT_EOF(fs) ((atari_format ? 0xfff : 0xff8) | FAT_EXTD(fs))
which are of course perfectly legal values.
However, Microsoft's specification of the FAT filesystem (see e.g. https://aeb.win.tue.nl/linux/fs/fat/fatgen103.pdf) says on page 18:
"Microsoft operating system FAT drivers use the EOC value 0x0FFF for FAT12, 0xFFFF for FAT16, and 0x0FFFFFFF for FAT32 when they set the contents of a cluster to the EOC mark."
I have verified on a Windows 11 system that this is indeed the case.
Also, in Linux's msdos_fs.h
the value was changed from (e.g.) 0xff8 to 0xfff a long time ago:
tbodt/linux-history@a22b907
Therefore I suggest to change these values to 0x0fffffff and 0xfff. This would follow the implementation in Linux and Windows, and it would get rid of an instance of the Atari conditional. Plus, given the rationale of the Linux commit, it may actually improve compatibility with some (buggy?) implementations.
I can provide a patch if wanted.