Date : Mon, 19 Dec 1983 12:19:00-PST (Monday)
From : Tony Li <Tli@usc-eclb>
Subject: Re: Free space on disk.
Finding the free space on disk under CCP/M is simple. CP/M isn't so
simple.
Under CCP/M, you can use the BDOS call DRV_SPACE (46 - 02eH). Input
argument is a drive number. Result is the first three bytes in the
DMA buffer. The bytes contain the number of free sectors on the disk.
The bytes are stored with least significant byte first (Sigh).
Under CP/M (I think - it's been a while), you can get the address of
the allocation vector if the disk is not read/only. This is done via
the DRV_ALLOCVEC (27 - 01bH) BDOS call. The allocation vector is a
bit messy. Probably the best way to look at it is the drawing by
Harvey Deitel in his book @b(An Intorduction to Operating Systems).
On page 550, he gives a good discussion of the allocation vector. Of
course, if you have manuals, this is even better.
Cheers,
Tony Li
;-)