Every field you pack here — the space-padded 8.3 filename, the 0xFFF end-of-chain marker — matches exactly what tools like mkfs.fat and fsck.fat validate, and what real DOS and early Windows machines wrote to floppies for two decades. Forgetting to write the FAT back to disk after updating it in memory is a classic bug that silently corrupts the whole filesystem on the next mount.