                               DriveSpeed (DRSP)
                           Version 3.10 GPL FREEWARE

                        Copyleft (l) Stanislav Sokolov,
                             May 1998 and onwards



1.  What is DRSP?
2.  Why DRSP?
3.  What DRSP does?
4.  What DRSP does not do?
5.  COMMAND-line arguments.
6.  Common errors.
7.  Requirements and compatibility.
8.  History.
9.  Return values and batch mode.
10. DriveSpeed Control Center (Windows front-end).
11. Contacting the author.
12. License and distribution.
13. Disclaimer.

==============================================================================

1. What is DRSP?
----------------

DRSP is a program that tests the write and read speed of any drive by
performing a series of DOS I/O operations. It allows you to adjust test
parameters and log the results.


2. Why DRSP?
------------

For some time ago I discovered that there were no (known to me) programs,
which would give a relevant information about any drive's speed. Some
benchmarking programs give you a number (such as 156.3), which does not really
tell you *how* fast (or slow) your drive works. Some programs, which are able
to give a MB/Min information, can only test physical drives, leaving all other
drives untested. I could not put up with such situation, and put together a
small DRSP ver. 1.0, using QuickBASIC 4.5. That version was never published.
Having improved my programming skills, I have totally rewritten the program in
C++, adding many functionalities.


3. What DRSP does?
------------------
Drive Speed uses the most common sequential write and read operations
performed via DOS functions 3fH and 40H. The program can test any drive -
physical or device driven. If the drive is write protected (CD-ROM), DRSP can
be run in one of two read-only modes (discussed later).

First of all the program can check which drives are available, list them
together with information about free and total space, and volume label.

You will then be asked several questions to prepare the program for the test.
The first one is which drive to test. Simply press the relative drive letter
in answer to that question.

If you did not select the read-only mode from the COMMAND-line, DRSP will try
write to the drive to see if the drive is write-protected. If so, the next
question will be wether you want to run in read-only mode. There are two read-
only modes available - single-pass and multi-pass. I would recommend to choose
the single-pass mode as it gives more realistic results (multi-pass mode will
give results, which are slightly faster). The reason for having two modes is
caching. The multi-pass mode will find the appropriate file on the drive and
will read it n times. As read operation are cached, I use INT 2fH, function
4a10H, subfunctions 1H and 2H to commit and clear the contents of cache. Alas,
Windows 9x is not backward compatible in this issue and does not clear the
cache, so after the first read of the file all subsequent reads will be
performed from cache - instantaneously! Therefore I designed a single-pass
mode, which finds 17 (a sufficiently random number:) largest files (see next
section for defining of the maximum size) and reads them one after another in
one pass. In this case the operations are not affected by caching.

So comes the size of the test file. You specify the amount in megabytes. The
program then translates the value to kilobytes and compares it against the
available space on the drive. If the value you specified is larger than the
free space, the test-file size will be adjusted to match the free space. A too
small value will produce inaccurate results. I would recommend 0.5MB for
testing of floppy drives, and 3 to 5MB for other drives as minimum values.

If read-only mode was selected, the size of the test file gets another
meaning. In multi-pass mode the program will search for the largest file,
which is smaller or equal to the max. size specified. In single-pass mode the
program will search the drive for 17 largest files, so as the _sum_ of these
17 sizes does not exceed the max. size specified.

In read-only mode a file search will be performed at this point. You can
always abort the search by pressing 'Esc'. The file(s) found so far will then
be used. the search goes pretty fast, though; and the user is always informed
about the current status. The search will ignore the files which are locked by
the system (such as Windows swap file, while Windows is running), so don't be
surprised if you have some large file, which DRSP does not seem to find.

The last question is about how many times the program should repeat the test.
The absolute minimum is 3, while the value of 5- will give a reliable result.
In read-only single-pass mode this question will not appear.

The test is then run. It can only be aborted either after write or read
operations. Just press 'Esc', and the test will be aborted as soon as
possible. If you abort the test, no results will be displayed. Do not use
Ctrl-Break - the program installs a routine, which would ignore Ctrl-Break or
^C signals. During the r/w test the program writes the file (DRSPTEST.TMP) to
the root of the specified drive, and then reads it, accumulating the time
consumed by the operations. The cache is flushed between operations (Windows
9x ignores these calls).

Then, if you are not in read-only mode, DRSP performs a File Access Speed
(FAS) test. That means that the program creates, opens, closes and deletes a
file during 15 seconds the test is run. After this test the results are
converted to the number of operations per second. Many benchmarking programs
perform Disk Access Speed tests, totally forgetting that DOS also consumes
some time, while performing a file operation. This is especially true for
floppy disks. When one copies a large amount of files to a floppy, almost half
of the copying time goes on creating, opening and closing files on the floppy.

At the end of the test you will be prompted to store the results in a log-file
DRSP.LOG. If you answer affirmative, you will be asked to enter a one-line
comment to the test. Here you can for example write what kind of machine and
configuration you had. The result will be appended to previous results.
DRSP.LOG is a plain ASCII test-file, which is stored in the same directory,
where the executable is situated. The program is followed by a log-file with
the results from my system.

It should be mentioned here that if you start DRSP in batch-mode with /b
COMMAND-line argument, providing all other necessary arguments, the log-file
will be written without any prompt (you can add comments later).


4. What DRSP does not do?
-------------------------

DRSP is rather a safe program - it performs no low-level I/O operations,
redirecting everything through DOS. It makes it a bit slower than it otherwise
could have been, but after all, 90% of all applications perform their I/O
operations through DOS services. Thus the results are not so far away from the
average performance.

DRSP does not check if you have any disk caching utility installed, though
disk caching affects the results. Here again the results are adequate as you
would normally run your system with some caching utility on. DRSP would try to
flush the cache from time to time, but this does not work under Windows 9x.

DRSP does not check if it is testing a compressed drive (suck as Stacker).
Although DRSP tries to determine free space availably and not to exceed it,
some compressed drives will report more space than it is actually available.
In this case a write error during test may occur. Simply repeat the test with
a smaller size of a test-file. (Test file has an average compression ratio of
1.0:1 - that is, it can't be compressed.)

DRSP uses a DOS function, which only appeared with DOS 4.0, so it won't run on
elder versions.

DRSP won't crash your disk. At the first sight of a write error it will
terminate the test with an error message.


5. COMMAND-line arguments.
--------------------------

DRSP accepts arguments, passed to it from COMMAND-line. Any combination of
upper- and lower-case letters is allowed

     n:        Specify which drive to test. n is the drive letter ranging from
               A through Z. Both upper and lower case letters are allowed.

     /sn.n     Set size of the test-file, where n.n is the size in megabytes.
               In read-only mode this value gets a new meaning. DRSP will
               search for the file (or accumulation of files) that is not
               larger than n.n megabytes.

     /tn       Set the number of turns the test shall be repeated. n is the
               number between 3 and 999.

     /rs       Toggle read-only test in single-pass mode.

     /rm       Toggle read-only test in multi-pass mode.

     /b        Run in batch-mode. The program will not ask for confirmations
               and will log the test results. Note, however, that you must
               give all the appropriate arguments. If any of the arguments
               have wrong values, the program will terminate with one of the
               exit statuses (10, 11 or 12).

     /l        Use another log-file. This argument is mainly intended to be
               used when DRSP.EXE is located on a read-only medium, so that
               the default log-file cannot be written. Note that the path and
               filename information must be located directly after /l, without
               any white-spaces in between. If DRSP fails to open the user-
               defined log-file, it will attempt using the default one. If
               that attempt fails too, DRSP exits with errorlevel 13.

     /?  -?    Help screen.

If you omit any of the arguments, or enter an invalid value, you will be
prompted to enter the value from inside the program. There must be no blank
characters (space or tab) between the switch and the value it specifies. If
you make use of COMMAND-line arguments, the question about searching available
drives will not be shown.

Explained examples:
          DRSP c: /t5 /s4.5   Test drive C: using 4.5MB test-file, and
                              repeating the test 5 turns.
          DRSP c: -s4.5       The same as above, only you will be prompted to
                              enter the number of turns from within the
                              program.
          DRSP c: /s4.5 /b    The same as above, but the program will abort
                              with errorlevel 12, because the batch-mode was
                              selected.
          DRSP j: /rm /s20    Test CD-ROM drive J: in read-only multi-pass
                              mode, searching for the file that is no larger
                              than 20MB, the number of turns will be prompted.
          DRSP c: /t 7 /s 8   Error! The program will ask you to enter both
                              the number of turns and the size.
Complete examples:
          DRSP a: /t3 /s.6
          DRSP c: /t4 /s15 /b
          DRSP d: /s40 /t5 /lc:\dos\mylog.txt /b /rm
          DRSP e: /s100 /rs /l..\newlog.txt


6. Common errors.
-----------------

There are four known possible error types:

 Error I.      Error opening test-file. - Can occurs at the beginning of a
               test. The program was unable to open a test file because: a)
               The drive you wish to test is write-protected (or a CD-ROM
               drive) b) DRSPTEST.TMP already exists in write-protected form,
               c) you did not have any more root directory entries available,
               d) there was a disk error (run ScanDisk, NDD or something like
               that).

 Error II.     Error writing to file. - Can occurs during the test. The
               program was unable to write to the test-file due to one of the
               following reasons: a) disk was unexpectedly full because
               another process in a multi-tasking environment (Windows) filled
               it b) a compressed drive reported more space than it is
               actually available (DRSP writes random-generated strings so
               that test-file can almost not be compressed).

 Error III.    Overflow in a variable. - Can occur after the test. You
               selected a too small test-file size on a relatively fast drive.
               This will produce unrealistically huge speed-results, which can
               eventually overflow the variables.

 Error IV.     Critical error while ... a file. - This error message type can
               occur during FAS test. Ellipsis represent the operation which
               caused an error. Though, if the first part of the test was
               successful, there is no reason why FAS should fail.

 Warning I:    If the program is terminated during the test in an abnormal
               way, such as power off, test file DRSPTEST.TMP will not be
               deleted. You should then remove it manually. It is placed in
               the root directory of the drive you tested prior the
               termination.

 Warning II:   Used and free space on a drive may be shown wrong on CD-ROM and
               network drives. I use INT 21H, function 36H to get the size of
               a drive. Device drivers may report something that is not
               correct to DOS. E.g. my CD-ROM always reports 134MB used on any
               disk, even though it is not true in most of the cases. This
               number is then reported by DOS to the requesting programs, so
               that both my DRSP and Norton Commander show this number. Until
               I find out how to fix it - it is just a feature, and not a bug!

 Warning III:  DRSP is _not_ Year 10000 compatible.

I have thoroughly debugged the program, but I am not the God, so there may
still be some flaws remaining in the code.

If you experience any other errors, not listed here, please send me a letter
(or e-mail) telling about them (see Contacting the author). Please include
which parameters you selected (test-size, # of turns, etc.), and the
characteristics of the drive you tried to test.


7. Requirements and compatibility.
----------------------------------

The program can be run on almost any IBM-PC compatible computer. It requires a
286 processor, 107K RAM, and DOS 4.00 and later. DriveSpeed Control Center
requires Windows 3.1 or higher and a Visual Basic Run-Time Library
(VBRUN300.DLL). The front-end was tested on Windows 3.1, Windows 98 and
Windows NT.

DRSP was successfully tested on floppy drives (both 5.25" and 3.5"), harddisk
drives, network drives (Novell, Windows NT), RAM-drives, compressed drives
(Stacker), ZIP-drives (ATAPI and parallel) and several CD-ROM drives. The
program is also compatible with Windows 9x (both FAT16 and FAT32) filesystems.


8. History.
-----------

Version   What's new.
..............................................................................

3.10      Wrote a Windows front-end to give a convenient way of testing
          multiple drives. Added a parameter allowing to choose different log-
          files. Small source modifications.

3.00      The two modes of read-only testing are added. The program is now
          able to test CD-ROM drives. Batch mode is added. Cache flushing on
          systems prior to Windows 9x is added. The timer is now more
          accurate, taking into account the hundredths of a second. The
          program now exits with various errorlevel values. Added time-
          stamping of log entries. The program now emits a sound (45 Hz, 1.1
          sec.) when it is finished with a test. Source code is totally re-
          organised. Corrected the error in kb/sec calculation - the program
          showed earlier a speed in bytes/sec! Sorry! Some small bugs removed
          (and some new ones are introduced...)

2.21      Changed the licensing to GNU General Public Licensed freeware.
          Source is now included. Minor cosmetic changes.

2.20      File Access Speed (FAS) test added. Minor cosmetic improvements.
          Code is modified to give better memory usage. Pressing 'Esc' while
          entering comments does not abort appending of results to the log-
          file. (After all, the user gets a separate question if he/she wishes
          to append the results!)

2.10      Added COMMAND-line arguments. One can now bypass the questions
          inside the program. Added handler for floating point errors.

2.01      Corrected the bug from ver 2.00. Added the possibility of aborting
          the test while it is running, by pressing 'Esc'. Added RAM-drive
          detection.

2.00      The program is totally re-written in C++. It has become faster, and
          more user-friendly. Alas, after releasing it on DOWNLOAD.COM, I
          discovered a bug, which prevented users from selecting a drive to
          test. About 370 people downloaded this version before corrected ver
          2.01 got into release. If you are one of those - sorry.

1.00      The program is born in QuickBASIC 4.5. It's functional, but not
          user-friendly at all, and a bit slow. It has never got released.


9. Return values and batch mode.
--------------------------------

On exit DRSP will return one of the following values. You can use DRSP in a
batch program, checking this value with "IF ERRORLEVEL x GOTO label"
statement:

     Normal exit         0
     User termination    1
     Can't make log-file 2
     Can't open file     3
     Can't write to file 4
     Can't close a file  5
     Can't delete a file 6
     DOS ver too old     7
     Out of memory       8
     Math error          9
     Bad drive selected  10
     Bad size selected   11
     Bad number of turns 12
     Can't make log-file 13

To invoke DRSP in batch mode, use the /b COMMAND-argument. The arguments,
which specify the drive letter, test size and the number of turns must be also
given. If any of these arguments have a wrong value, DRSP will exit with
statuses 10 through 12. If DRSP fails to write to the drive, it will
automatically switch to a read-only multi-pass mode.

In .\BATCH directory you will find 2 .BAT files. TESTRET.BAT demonstrates
usage of the return values by running a single test and doing a series of IF
ERRORLEVEL comparisons. TESTFOR.BAT uses a DOS FOR-function to attempt testing
of all the drives on the system. For this purpose I have created 26 1-letter
files in the range A through Z, the names of which are substituted in the
place of a drive letter specification in the batch file. Both batch files
assume that DRSP is located in a directory, which is placed in you PATH
environment.


10. DriveSpeed Control Center (Windows front-end).
--------------------------------------------------

For those of you who feel lost and scared in the DOS, I have written a Windows
front-end for DriveSpeed - DriveSpeed Control Center (DRSPCC). DRSPCC is
compatible with both Windows 3.x, Windows 9x and Windows NT. The Control
Center allows you to test several drives in one run. Select the drives you
want to test from the available ones. You can configure test-parameters for
each drive individually. These parameters will be saved across sessions in the
DRSPCC.SAV file. Note that you can right-click a drive letter if you want to
select that drive for configuring without changing its on/off status. For
information about the configurable parameters click the buttons, marked with
"?". Read also "What DRSP does?" and "COMMAND-line arguments" sections of this
manual. 

Press the "Run test(s)" button to start testing the selected drives. DRSPCC
makes use of DRSP-RUN.PIF file, which allots 99.9% of Windows resources to
DRSP.

If you run the tests in the batch mode, the "DriveSpeed" window will disappear
faster that you will be able to read the results of the completed test. The
current results of the tests can be viewed in the log-file, which can be
displayed using the internal viewer by pressing the "Show log-file" button.
The internal viewer loads the updated version of the log-file after each test
is completed. Unless you selected a specific log-file to be used, DRSPCC will
search for the location of DRSP.EXE executable file (in the same order as
Windows does) and will try to load the default DRSP.LOG log-file, which would
be located in the same directory as DRSP.EXE. If you give a specific log-file
name and location and it does not exist, DRSPCC will attempt loading the
default file. If DRSP manages to create a user-defined log-file DRSPCC will
start using it. Note, that the files that are larger than 32600 bytes cannot
be displayed in their full length. DRSPCC will front-truncate the large file,
showing only the last 32600 bytes, notifying the user about the fact. You can
print the log file in the whole or, if only a portion of the text is selected,
partially.

At any time during the test you may press the "Stop" button. This will stop
DRSPCC from testing any more of the selected drives. DRSP will however
complete the test of the currently tested drive. If you want to stop the tests
immediately, first press the "Stop" button, then switch to "DriveSpeed" window
and press 'Esc' 1 or 2 times.

DRSPCC is written in Visual Basic 3.0 and requires a run-time library. This
library is not included with the main archive because of place considerations
and can be downloaded separately from one of the following sites:
  http://www.fortunecity.com/victorian/christy/22/prog/vbrun300.rar   (216k)
  ftp://ftp.simtel.net/pub/simtelnet/win3/dll/vbrun300.zip            (226k)
  http://www.simtel.net/pub/simtelnet/win3/dll/vbrun300.zip           (226k)
Extract VBRUN300.DLL and place it in WINDOWS\SYSTEM directory or in the same
directory, where DRSPCC resides.


11. Contacting the author.
--------------------------

If you have any comments, suggestions or bug-reports, please contact me either
by e-mail or snail-mail. My addresses are:

Snail-mail:
     Stanislav Sokolov,
     Snorresvei 24,
     1473 SKRER,
     Norway

E-mail:
     stanislavs@hotmail.com

Internet:
     http://members.tripod.com/~stanislavs/


12. License and distribution.
-----------------------------

This program is a GPL Free Software. You are free to use, share and modify it
(as long as I am informed). See COPYING file for details. If you like the
program, send me a (e-)postcard telling so ;)

The program can be distributed by all means (Internet, CD-ROMs, floppies,
etc.) as long as the distributor does not take money for the program itself
(distribution costs can be covered in any appropriate way). I should
preferably be informed prior to the distribution taking place. The contents of
the distribution must not be altered, all the files listed below should be
present:

  COPYING                 Licence agreement
  DRSP.EXE                The Executable (copy to a directory in PATH)
  DRSPCC.EXE              Windows front end
  DRSP-RUN.PIF            Windows run file for DRSP.EXE (Used by DRSPCC.EXE)
  DRSP.LOG                Sample log file (copy to the same dir. as DRSP.EXE)
  README.TXT              This file
  FILE_ID.DIZ             A short description
  BATCH\?                 26 1-letter files used to generate drive-names
  BATCH\TESTFOR.BAT       A batch test file
  BATCH\TESTRET.BAT       A batch test file
  SRC\DRSP\DRSP.H         \
  SRC\DRSP\DRSP.CPP       | Source files for the program. You'll also need
  SRC\DRSP\RESULTS.CPP    | a part of my User library to compile the
  SRC\DRSP\GETSINFO.CPP   | program (can be obtained from my site)
  SRC\DRSP\DIAGS.CPP      |
  SRC\DRSP\HANDLERS.CPP   /
  SRC\DRSP\DRSP.PRJ       Turbo C/C++ project file
  SRC\DRSPCC\DRSPCC.MAK   \
  SRC\DRSPCC\BROWSE.FRM   |
  SRC\DRSPCC\DRSPCC.FRM   | DriveSpeed Control Center source files. This
  SRC\DRSPCC\DRSPCC.FRX   | Windows front-end is written in Visual
  SRC\DRSPCC\VIEWER.FRM   | Basic 3.0
  SRC\DRSPCC\VIEWER.FRX   |
  SRC\DRSPCC\DRSPCC.ICO   |
  SRC\DRSPCC\VIEWER.ICO   /



13. Disclaimer.
--------------

#include <standard_disclaimer.h>
     or see
http://members.tripod.com/~stanislavs/prog/prog.htm

==============================================================================
                               End of README.TXT
                  This document is written in WordPerfect 5.1