Hi Mike,

> Ulrich Hansen just reported a bug in my FTP server and I have verified 
> it.  The technique that I use to detect if a drive is valid behaves 
> differently under FreeDOS than under PC DOS or DOSBox.
> 
> Can anybody point me to documentation or code for DOS INT 21,32h ?  The 
> function is "Get Pointer to Drive Parameter Table", and I expect to get 
> a return code of FF if the drive number passed in is not valid.  It 
> looks like on FreeDOS it is reporting every drive letter that I test as 
> invalid, so it is not implemented or implemented differently.

No, it actually behaves as expected if you see this in DOSEMU: Only
FAT drives have a DPB, but network / redirector / CD / DVD drives
do not, so as RBIL already says: "FFh invalid or network drive" ;-)

Maybe you could do similar to WHICHFAT: Check int 21h function 36h,
which checks for free disk space, number of clusters, etc:

> INT 21 - DOS 2+ - GET FREE DISK SPACE
>         AH = 36h
>         DL = drive number (00h = default, 01h = A:, etc)

> Return: AX = FFFFh if invalid drive
>         else
>             AX = sectors per cluster
>             BX = number of free clusters
>             CX = bytes per sector
>             DX = total clusters on drive

> Notes:  free space on drive in bytes is AX * BX * CX
>         total space on drive in bytes is AX * CX * DX
>         "lost clusters" are considered to be in use
>         according to Dave Williams' MS-DOS reference, the value in DX is
>           incorrect for non-default drives after ASSIGN is run
>         this function does not return proper results on CD-ROMs;
>           use AX=4402h"CD-ROM" instead
>         (FAT32 drive) the reported total and free space are limited to 2G-32K
>           should they exceed that value

> SeeAlso: AH=1Bh,AH=1Ch,AX=4402h"CD-ROM",AX=7303h

In DOSEMU, this will report mapped drives as 0 used, almost
2 GB free, FAT diskimage drives as what they are (you can
check the cluster count to distinguish FAT12, FAT16, FAT32)
and for floppy and CD/DVD drives it will first access that
disk so you want to avoid that to avoid "not ready" errors.

In plain DOS on actual hardware, the same will happen, but
there will be no "mapped from Linux" drives, of course ;-)

Eric


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to