File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -364,7 +364,14 @@ unsigned long extended_dos_getdiskfree(unsigned drive, int *error)
364364 intdosx ( & r , & r , & s );
365365
366366 /* see if call supported, if not then fallback to older get disk free API call */
367- if (!(r .w .cflag & 0x01 ) && (r .h .al ))
367+ /* Note: from RBIL returning AL=0 (with carry unchanged/clear) means unimplemented,
368+ in such cases AH is unchanged, so will AH will still by 0x73, i.e. returning AX=0x7300
369+ EDR kernel returns with AX=0 if successful so error must check AX=7300 instead of just AL for 0
370+ FreeDOS kernel returns with AX unchanged, i.e. 0x7303 on success
371+ If returns carry set then AX is undefined, but an error.
372+ (carry OR (AX == 0x7300)) indicates error, so we check for NOT (carry OR (AX == 0x7300))
373+ */
374+ if (!(r .w .cflag & 0x01 ) && (r .w .ax != 0x7300 )) /* call available and successfully returned */
368375 {
369376 /* calculate free space, but handle some overflow cases (or switch to 64bit values) */
370377 clustersize = FAT32_Free_Space .sectors_per_cluster * FAT32_Free_Space .bytes_per_sector ;
You can’t perform that action at this time.
0 commit comments