DOS System Calls on FAT32 / NTFS Volumes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does any one know if the DOS System Call (int 21H) "Get Disk Free Space
(function 36H) gives meaningful/correct results on FAT32 and NTFS File
Systems?
If they are not right, then where do these values come from?

I am getting surprising values on both these types and they identical for
both, on the same PC, even though they have different capacities.

However the results for floppies (FAT12) and CDs (CDFS) are correct.
 
XRaySpeX said:
Does any one know if the DOS System Call (int 21H) "Get Disk Free Space
(function 36H) gives meaningful/correct results on FAT32 and NTFS File
Systems?
If they are not right, then where do these values come from?

I am getting surprising values on both these types and they identical for
both, on the same PC, even though they have different capacities.

However the results for floppies (FAT12) and CDs (CDFS) are correct.

Not very likely. Windows is not DOS, and the registers used
for this call will overflow. Furthermore, DOS does not understand
NTFS. Throw out your DOS assembly language book and use
proper Windows system calls.
 
You just guessing?

Windows does run many DOS programs and does provide DOS Windows.
I don't mind overflow, as long as I know its happening. However there is no
evidence of truncation.

DOS might not understand NTFS but there is no logical reason for it to not
handle (most of) FAT32.

Thank you but I shall not be giving up programming for DOS just yet. It is
invaluable when Windows won't boot and I can inspect and, if necessary, edit
disks under a DOS or WIN95 boot disk.

I want my programs to run with or without WIN32.
 
XRaySpeX said:
You just guessing?

Windows does run many DOS programs and does provide DOS Windows.
I don't mind overflow, as long as I know its happening. However there is no
evidence of truncation.

DOS might not understand NTFS but there is no logical reason for it to not
handle (most of) FAT32.

Thank you but I shall not be giving up programming for DOS just yet. It is
invaluable when Windows won't boot and I can inspect and, if necessary, edit
disks under a DOS or WIN95 boot disk.

I want my programs to run with or without WIN32.>

Your program may have to detect whether it runs under
a 16-bit or under a 32-bit OS, and use one or the other
set of system calls.

When I deal with a non-booting installation then I boot the
machine with a Bart PE boot CD and run my binary disk or
partition table editor from there. Much easier than re-inventing
the wheel.
 
I know, but that wasn't the question.

I would appreciate an answer from someone who has actual knowledge of the
subject.
 
Anyway programs compiled with WIN32 API calls refuse to run at all under
DOS, even if they test for the OS and jump round the WIN32 API calls.
 
XRaySpeX said:
Does any one know if the DOS System Call (int 21H) "Get Disk Free Space
(function 36H) gives meaningful/correct results on FAT32 and NTFS File
Systems?
If they are not right, then where do these values come from?

under what environment are you making the call? From within an XP command
window: you're running inside XP's emulation of a 16-bit environment, and
the calls should work fine. From within DOS itself (you booted the
machine into DOS): the fat should work, but DOS won't recognise the NTFS
partition/volume at all.

Remember, XP "stands alone", it is not built on-top-of anything else, so
all older API calls are emulated internally by XP. For the most part they
"work as they aught to", within the restrictions of the parameter
types/sizes.
 
From within an XP Command Window, but it gives nonsensical (but equal) values
for FAT32 and NTFS partitions.
Thanks.
 
When I deal with a non-booting installation then I boot the
machine with a Bart PE boot CD and run my binary disk or
partition table editor from there. Much easier than re-inventing
the wheel

Greetings Pegasus- I've made 3 BartPE CDs & I think they r
super. Is there a FIXMBR & FIXBOOT routines for Bart's &
have u used them?

Your help is MUCH appreciated. Thanks- bye- Larry


Any advise given is my attempt to show appreciation for all
the excellent help I've received here but I'm no MVP so it
may only apply NUGS (Normally, Usually, Generally, Sometimes :)
 
Larry(LJL269) said:
Greetings Pegasus- I've made 3 BartPE CDs & I think they r
super. Is there a FIXMBR & FIXBOOT routines for Bart's &
have u used them?

Your help is MUCH appreciated. Thanks- bye- Larry

Fixmbr and fixboot are Recovery Console commands. They
do not exist in Windows and they therefore do not exist on
the Bart PE CD. Boot the machine with your WinXP CD
into the Recovery Console to run them.
 
A clunky way to work out your free disk space consists
of spawing a command processor from within your
program and getting it to run the "dir" command.

Another solution might be to talk to the author of snapshot.exe
(http://www.drivesnapshot.de/en/down.htm). This tool runs
under DOS and under Windows and I get the impression that
it can successfully read the various disk parameters.
 
Back
Top