Rod Pemberton wrote:
> Does anyone know of a DOS/Win98 utility to "mount" a filesystem image
> (loopback?) or cause the image to be accessed as if it is a drive
> under DOS (like a ramdisk)?
>
> If I use the Windows ****t of Linux's mkdosfs to create, say a FAT16
> filesystem image (not a partition),
> http://www.mager.org/mkdosfs/
>
> or, if I use rawread.exe or partcopy (John Fine) to create a FAT12
> filesystem image .img from a floppy, is there a utility or .sys
> driver to make that file/filesystem image/disk image a drive
> (E:,F:,G:, etc.) in the DOS or Win98 drive chain?
>
> Or, perhaps, a ****t of MTOOLS for DOS or Win98?
>
> I found a partially implemented DOS ****t (insufficient) of MTOOLS
> here: http://www.frontiernet.net/~fys/mtools.htm
>
> I did locate a program called DiskImg for WinNT...
What do you want that for? To create a disk image with some files in it
for
the use with the OS? Or do you want to test your FAT code on such an
image?
Both?
For the testing purposes I wrote a rather dumb application that creates
for
me two complete HDD images:
1st:
//
// Active Type Size Cluster Size Letter Layout
// FAT12 CHS ~4 MB 1 KB F: 1 boot, 32 root,
4084
clusters => 2*12 FATs, 8168 data = 8225
// x FAT16 CHS < 31 ~4 MB 1 KB C: 1 boot, 32 root,
4085
clusters => 2*16 FATs, 8170 data = 8235
// Ext CHS 1+65689+32932=98622
// FAT16 CHS ~32 MB 2 KB D: 1 boot, 32 root,
16382 clusters => 2*64 FATs, 65528 data = 65689
// Ext CHS 1+32931=32932
// FAT16 CHS ~16 MB 1 KB E: 1 boot, 32 root,
16384 clusters => 2*65 FATs, 32768 data = 32931
// FAT16 LBA ~128 MB 2 KB G: 1 boot, 32 root,
65524 clusters => 2*256 FATs, 262096 data = 262641
//
1+8225+8235+98622+262641=377724 ~184 MB
2nd:
//
// Active Type Size Cluster Size Letter Layout
// x FAT32 LBA ~256 MB 4 KB C: 2*6=12 boot, 65525
clusters => 2*512 FATs, 524200 data = 525236
// 1+525236=525237
//
The images contain proper MBRs, bootsectors and initialized FATs, where
the
only missing things are: code in MBRs/boot sectors and CHS values in MBRs.
I
don't use those and so I don't compute and put them in.
I ran my FAT unit test with these images mounted. Seems like with this
unit
test and these images I cover over 80% (as per gcov) of my FAT code. Which
is a quite good number given the fact the code that isn't covered is
mostly
this:
- I/O error handling
- FAT error/corruption handling -- honestly, I don't plan to make the code
unbreakable or make FAT checking/fixing tools
- floppy changes -- requires a model of a floppy drive, just file I/O
isn't
enough to test this functionality automatically, the same applies to I/O
error handling too -- this is a testability issue
- big files (4 GB) -- also a testability issue -- a 4GB file needs an
image
bigger than 4GB, which means that the image must be scattered across
several
files of size under 4 GB or whatever the host OS or standard library has
the
limit for file sizes
- redundant parameter checks
- some redundant (general-purpose) code
If you're interested in testing FAT code or playing with mine, stay tuned,
I'm gonna release an updated version soon with the test suite. Automatic
testing and code reviewing prove useful as they have revealed 5+ more
bugs,
which isn't a big surprise for 5000+ lines of code.
Alex


|