-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e2b679
commit fdd4509
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FREESP -- Chartreuse 2021 | ||
|
||
Calculates the free space on a FAT 16 disk very fast. | ||
On XT Class systems with large FAT 16 hard disks the initial DIR | ||
command can take upwards of 15-30 seconds to complete, this is due to | ||
the slow method that DOS uses for calculating free space on the hard | ||
disk. However once DOS has calculated this value it stores a cache of | ||
it which it keeps updated unless an application does raw disk accesses | ||
such as CHKDSK. This means that every subsequent DIR will take no time | ||
to display free space. This program is designed to quickly calculate | ||
the free space on the disk by reading through the FAT and counting up | ||
the used clusters then calculating the total number of clusters on the | ||
disk and subtracting to get the number of free clusters. Once | ||
calculated this value is stored into the Disk Parameter Block from DOS | ||
in the field storing the free clusters which DIR uses for calculating | ||
free space. With a 2GB FAT 16 partiton on a CF card in an XTIDE | ||
on my Turbo XT (running at 4.77MHz) this program takes <2s to complete | ||
while the initial DIR call takes 25s. | ||
|
||
This program should run on any PC or compatible with DOS 4.0 or later | ||
it has only been tested on MS-DOS 6.22. This program should be unneeded | ||
on DOS 3.2 and earlier as DIR does not perform a free space calculation, | ||
as well these versions also use FAT12 for disks which DOS keeps more | ||
metadata in memory and will avoid the slowdown. It requires 66kB of | ||
free memory to run, but once complete does not use any, it is not a TSR. | ||
|
||
Usage | ||
------------ | ||
|
||
FREESP <A-Z> | ||
|
||
Example: | ||
FREESP C | ||
|
||
This will pre-calculate free space on the C partition. I recommend | ||
putting this program into your AUTOEXEC.BAT for each partition on your | ||
system. If you are using 4DOS then you'll want to do this as 4DOS will | ||
perform the free-space calculation before the running of a command | ||
when it has to search the PATH. | ||
|
||
Assembling | ||
-------------- | ||
This program was created to assemble under Borland Turbo Assembler 2.01 | ||
with Borland Turbo Link 2.0 | ||
|
||
TASM FREESP.ASM | ||
TLINK /T FREESP.OBJ | ||
|
||
This will produce FREESP.COM | ||
|
||
|