Moved from our bugzilla item 1021:
1) in the boot loader code for FreeDOS, you assume that (in the FAT)
only 0xFFF is an END-OF-FILE marker, which, although perhaps in the
FreeDOS specs, that may be the only EOF marker, but it seems that
linux (and I seem to recall from my days of "twidling" with DOS), the
0xFF8 is also considered an EOF marker.
Thus if I erased the file "KERNEL.SYS", and then copied it back there
in Linux, the machine will be fetching invalid FAT entries.
I suggest a simple fix:
instead of checking for 0xFFF, check for anything greater than the
number of clusters on that drive (which is safer anyways).
2) in the "findFirst / findNext" code of the boot loader, it assumes
that there are fewer than the *exact* amount of directoriy entries
taken in the root directory, if however, you have 224 files (example
emty files) in the root directory, the find first/next "falls"
through into the "findKernelSys" area with an invalid AX (causing
problems similar to issue #1 mentioned above)
upon failure add the following line:
*Bart Oldeman* 2003-10-15
1) is partly fixed (0xff8 or higher, not number of clusters on drive)
2) is fixed (I think), however is a rare occasion.
Changing priority to "enhancement"/"P5", as "no EOF marker
but invalid cluster number" will only be encountered by the
boot sector if your FAT is corrupted. Treating invalid
clusters as end-of-chain is only improving the ability of
FreeDOS to boot from damaged filesystems.