Mail Archives: djgpp-workers/1997/10/16/17:32:35
I don't know how reliable this is, but I just found out how to detect
fat32 drives: attempt to read sector 0 (or any other, I imagine)
using int 25,cx=0xffff. This will return with carry set and ax==1
(invalid function) if the drive/partition is fat32. This function
works as normal for non-fat32 drives (floppies, anyway).
For those interested, I found this out while testing some of my lfn
driver code (I'm busy writing lfn support for non-windows dos with
fat32 support built in) and a function I'ld already tested and
debugged suddenly failed to read the disk.
I haven't tried this in dos mode yet, but I can't imagine dos mode
allowing this function to work either. I think M$ actually did
something right here: it's denied fat32 unaware programs access to
fat32 drives; programs HAVE to use the fat32 version of the disk
read/write functions (-D-217305CXFFFF in the interrupt list).
(for Ralf) Yes, the docs for int 25/26 say to use 217305 if the drive
is fat32, but it doesn't mention the returned error code (ax=0x0001)
nor does it say that 217305 MUST be used (I had the fealing of a
recomendation rather than a requirement). Also, I think the use of
int 25 for detecting fat32 should be mentioned.
I just went off and tried this in dos mode and got different results.
int 25 didn't work at all (cf=0, ax=0x0207) for both c: and a: (I
also tried locking c:, no change).
I have to modify my code to use 217305 and I'll report back on the
results when I get them. It seems W95 (IFSMGR?) remaps int 25/26 to
int 21/7305 when accessing floppy drives (or non-fat32 drives??) or
does the access itself, but msdos 7.1 doesn't work at all with int 25
(and 26 I imagine).
Bill
--
Leave others their otherness.
- Raw text -