[Freemint-list] dosfsck which marks filesystem clean?

Thorsten Otto admin at tho-otto.de
Tue Jun 6 02:59:02 MSD 2017


Am Montag, 5. Juni 2017, 00:48:21 schrieb Miro Kropáček:
> Of course, the right approach is to fix (or upgrade) the dosfstools package
> but it's not that easy, source code is .... rather hard to understand.

hm, not really that hard. I have forked the repo, and adapted the mint patch. 
Took about 1 hour. The only problem is that the dirty bit handling they 
implemented is different from what mint expects. They set some flag in the 
boot sector, while the mint patch tests (according to FAT specification) a bit 
in the first 2 cluster numbers of the FAT. That may also be the cause of the 
problems: that bit in the boot sector is reset, but the one in the FAT is not.
Also, for 16-bit FATs, the dirty bit in the boot sector is set/cleared only 
for non-atari formatted disks.

Seems the bit in the boot sector is what linux/68k uses, while the bit in the 
FAT is what Windows would also check. There is also an issue open about this.
The bit in the FAT is also what the MiNT kernel sets/clears.

I have tried to implemented setting/clearing that bit for MinT now. when 
testing it, watch out for a few quirks:

- the mint patch makes the command line usage slighty different from 
linux/m68k. On linux, both fsck+mkfs default to atari format of the  
bootsector, and the msdos format can be forced by using -A.
In the mint patch, the tools behave differently:
- for fsck, you have to use -A to force DOS format, and -AA to force Atari 
format. However, -A is actually a toggle, and the default is taken from the 
partition ID xhdi returns. That may work for filesystems on harddisks, but not 
when testing image files.
- mkfs defaults to Atari format, and you can force use of DOS format by using 
-A

I have run the included tests manually and they seem to work. But the 
reference data are all DOS filesystems. The tests need a xxd tool from the vim 
distribution which is just a single source file and compiles fine with 
mintlib.

The patches are on the mint branch of dosfstools 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.atariforge.org/pipermail/freemint-list/attachments/20170606/44d50f6d/attachment.html 


More information about the Freemint-list mailing list