Hack 65 Speed Up DOS with SMARTDRV 
You can add a boost to disk performance with
the DOS SmartDrive program.
Caching
or reading data from a
hard drive and storing it in RAM is one method to speed up disk drive
performance. Most disk drives have at least some RAM dedicated to
buffering data between the disk and the data cable, some disk drive
interface cards and chips provide data caching, and even DOS and
Windows provide disk
caching.
DOS's own SmartDrive program, SMARTDRV.EXE, provides
a tremendous performance boost for DOS systems. (If you install
SMARTDRV for a Windows 95-98 system, Windows unloads SMARTDRV at
startup. With or without SMARTDRV for DOS, Windows provides its own
disk caching driver, VCACHE, to speed up disk performance [Hack #66] . For Windows Me and later,
the device drivers and
VCACHE provide disk
caching.)
Loading SMARTDRV in DOS before running any DOS program or manually
installing Windows will speed up the process tremendously.
SmartDrive provides a number of options for you to configure it, but
as often as not, the simplest invocation is the best—it just
works. SMARTDRV's command line can look pretty
convoluted with all these options, as shown and listed below, but the
final examples shown are more than adequate for most of us:
SMARTDRV [/X] [[drive[+|-]]...] [/U] [/C | /R] [/F | /N] [/L]
[/V | /Q | /S] [InitCacheSize [WinCacheSize]]
[/E:ElementSize] [/B:BufferSize]
The available parameters for SmartDrive are:
- /X
-
Disable write-behind caching for all drives.
- drive
-
Sets caching options on specific drive(s). Takes the form of a single
letter followed immediately by + or
-. The specified drive(s) will have write-caching
disabled unless you add +.
- /U
-
Doesn't load the CD-ROM caching module.
- /C
-
Writes all information currently in write-cache to hard disk.
- /R
-
Clears the cache and restarts SmartDrive.
- /F
-
Writes cached data before the command prompt returns (default).
- /N
-
Doesn't write cached data before the command prompt
returns.
- /L
-
Prevents SmartDrive from loading itself into upper memory.
- /V
-
Displays SmartDrive status messages when loading.
- /Q
-
Does not display status information.
- /S
-
Display status of read cache, write cache, and buffering for all
drives.
- InitCacheSize
-
Specifies XMS memory (KB) for the cache.
- WinCacheSize
-
Specifies XMS memory (KB) for the cache with Windows. If this option
is not specified, SMARTDRV will default the WinCacheSize to the
amount of extended memory available.
- /E :ElementSize
-
Specifies how many bytes of information to move at one time.
- /B :Buffersize
-
Specifies the size of the read-ahead buffer.
 |
To use SMARTDRV.EXE, you must have
HIMEM.SYS loaded in your
CONFIG.SYS file. To do this, add the line
DEVICE=\PATH\TO\HIMEM.SYS,
as in DEVICE=C:\DOS\HIMEM.SYS.
|
|
To implement SmartDrive, follow this example:
Open your C:\AUTOEXEC.BAT file using Windows
Notepad, the DOS Edit program, or another plain-text editor program. Insert either of the following lines near the top of the
AUTOEXEC.BAT file, before the CD driver, MSCDEX,
is loaded: c:\dos\smartdrv.exe /x
which loads SMARTDRV, caches everything, using all available memory
as needed, and writes data immediately to disk, or: c:\dos\smartdrv.exe C+ 1024 512
which loads SMARTDRV, caches everything, and uses a megabyte of RAM
for DOS but only 512 KB of RAM under Windows; data written to drive
C: is cached/delayed for faster performance. Save the newly edited C:\AUTOEXEC.BAT file and
then restart your system. Alternatively, you can launch SMARTDRV from
the DOS prompt with the desired arguments.
|
Main Menu
|