Hi Jim,

> I am possibly going to rewrite my df utility to work with freeDOS' FAT32 
> filesystem (DJGPP uses int21h function 36h which is 16-bit FAT16 and 16-bit 
> regs).
> 
> I cannot find any documentation on the functions that freedos uses for its 
> filesystem functions, like getting filesystem volume space calculations 
> (total & 
> available).
> 
> can anyone help me?

Indeed this is documented in Ralf Browns Interrupt List RBIL.
You can look at my tiny 2005 example FAT32 size info tool:

http://ericauer.cosmodata.virtuaserver.com.br/soft/specials/
free-disk-space-tester-freetest.zip

(Thanks to Alain for mirroring, my page is more down than up :-!)

Binary is 1kB, NASM source 9kB so there are enough comments ;-)

Regards, Eric



>         mov ax,7300h    ; get a FAT32 property
>         mov dl,0        ; current drive
>         mov cl,1        ; "dirty-buffers flag"
>         int 21h
>         cmp ax,7300h    ; AX still unchanged?
>         jz oldkernel
>         ; ignore the actual results of int 21.7300 (AL, AH)
>         mov byte [kern32],1     ; kernel has FAT32 support
...

>         mov al,[drvnam] ; drive letter
>         mov [what32],al ; plug letter into "x:\",0 string
>         mov dx,what32   ; in DS: string
>         mov di,size32   ; in ES: size info buffer
>         mov cx,30h      ; buffer size, at least 2ch
>         mov ax,7303h    ; get extended free space
>         int 21h
>         jc bug2         ; error?
>                         ; Else: dd [free32+8]   = bytes per sector
>                         ;       dd [free32+14h] = free sectors
...

> kern32  db 0            ; flag: set to 1 if kernel supports FAT32
> what32  db "Q:\",0      ; the drive which we want to have checked
>         ; filled by int 21.7303.dsdx=&drvnam.esdi=&sizeinf.cx=2ch
>         ; which returns ax=7300 for non-FAT32 DOS versions or carry set
>         ; if FAT32 is supported but an error (AX) occurred during the call.
> size32  dw 30h  ; returns size
>         dw 0    ; returns version
> %if 0   ; rest of the data can be in uninitialized (BSS) space in RAM...
>         dd 0,0,0,0      ; sec/clust1, by/clust, free clusters1, total clusters
>         dd 0,0,0,0      ; free sect2, total sect2, free clust2, total clust2
>         dd 0,0          ; reserved
> %endif  ; 1: with compression adjustment / 2: without compression adjustment
>         ; even this can be clipped to 2 GB in Win9x: if a DOS TSR hooks int21,
>         ; some FAT1x compatibility feature triggers and clipping happens.
...

> Public domain free disk space checker by EA 2004-2005
> 
> Usage:
>   FREETEST [X:] [4]
> Drive spec is optional, default is the current drive.
> The digit is an optional size unit selector, default 1 kByte:
>   0->1k, 1->4k, 2->16k, 3->64k, 4->256k,
>   5->1M, 6->4M, 7->16M, 8->64M, 9->256M.
> Free space information is returned in errorlevel, 0 on error.
> 
> Example: FREETEST C: 5 returns errorlevel 50 if at least
>   50 MBytes are free on C:. Errorlevel is never above 255.


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to