Re: Re: Coming soon to your mailbox (part 2)

Eric Auer <[email protected]> Fri, 1 Nov 2002 02:37:15 +0100 (MET)
Newsgroups gmane.os.freedos.devel
Message-ID <[email protected]>
Hi Alain / Imre,

there already IS a 32bit FAT32 checking tool for DOS:
My DOS (djgpp) port of DOSFSCK (in dosfstools for Linux) is only lacking the
lowlevel disk access functions to be exactly what you suggest. It was quite
easy to port DOSFSCK using DJGPP (Bart had recommended that I should not even
try 16bit compilers, because of the bigger memory consumption of FAT32 checking
tools and similar issues, and DJGPP turned out to be very much like its Linux
pendant gcc/g++, easing the port a lot).
The problem is that DOSFSCK only uses file I/O to access the partition. In Linux,
you just tell it to open "/dev/fd0" instead of "test.img", and voila, it will scan
the floppy. Because Linux offers partitions and drives as virtual device "files".
The DOS version, however, cannot use this mechanism, so my port currently can only
work with disk image files.
I have posted lots of hints on how to add a disk I/O layer to DOSFSCK (would get
active if the "image file" is called "x:" where x is the drive letter - otherwise,
the file I/O layer must stay intact in order to keep the disk image ability) to the
fd-dev list, but did not get to write it myself yet. Would be very nice if somebody
could help with that.
DOSFSCK has the disadvantage of only running in 32bit mode and having an user interface
that differs a lot from CHKDSK and SCANDISK.
It has the advantage that it can check FAT12/16/32 for lots of error types, repair most
of them, present some verbose output and simulate (eats even more RAM :-)) the changes
before they are written (scan -> write fix to buffer -> re-scan "as if buffer had been
written" -> no errors remaining? -> write changes to disk). Also has a little undelete
and drop function built in.

Hope I could motivate somebody to help with the disk I/O stuff in DJGPP... As said,
the version which I have currently online has all other features, but is limited to
disk images instead of real partitions.

Eric