Specifications
Page B-4 Appendix B
Another benefit of write buffering is it tends to eliminate duplicate disk writes, such as
bitmap updates during operations such as copying files and tape restores and prevents
head thrashing when reading through random access data files and writing a sequential
file out to the disk (as most report generation programs do).
B.3.1Potential Pitfalls
Obviously, there can be problems with write buffering, especially if either the system
crashes or is powered off while writes are pending in the write buffer. If either of these
two cases occur, all pending writes will be lost. Though this sounds like a major
problem, it can also happen if write buffering is not enabled. However, write buffering
increases the number of writes at risk.
To help reduce the possibility of data loss, certain safeguards have been put in place.
Writes are not buffered indefinitely; they are performed whenever the device is not
performing reads. Even if the drive is busy with read requests, the buffer is still
periodically flushed, based on a user definable "absolute flush time." Additionally, the
MONTST command automatically flushes the write buffer.
The primary write buffering risks are an errant software operation or a hardware failure
that causes a system crash.
Therefore, you must weigh the potential for data loss (which is always there) versus the
dramatic performance increase seen when using write buffering. If you are worried
about the reliability of write buffering, it may be worth keeping in mind that the AM-520
disk controller has always used write buffering on a track-by-track basis (not quite as
efficiently as the AM-137 write buffering scheme however). The SMARTDRV program
that comes with MS-DOS 5.0 does write buffering (you may have noticed the "Waiting
for system shutdown" message when re-booting a PC with CTRL-ALT-DELETE) and
Unix based computers have always done it.
B.3.2Setting Up Write Buffering
In order to enable write buffering, you must be using the full SCSI dispatcher
(SCZRR.SYS). Write buffering is enabled by adding parameters to the SYSTEM
statement used to load the driver. All hard disk subsystem drivers for the AM-137 SCSI
interface must be loaded into system memory. Appending "/N" followed by the
buffer-size and flush-period will enable write buffering for that device. For example:
SYSTEM DVR:devn/N buffer-size flush-period
where devn is the device you want to enable write buffering for (for example DSK and
SUB). One SYSTEM command is required for each different SCSI disk driver present in
the system. For example, if you had two 1.2GB SCSI-2 drives named as DSK0-36 and
DSK37-73 and one 540MB SCSI-2 drive named SUB0-17, you would need one
additional SYSTEM command for the DSK device (although it’s really two physical
drives) and one additional SYSTEM command for the SUB device.
PDI-00137-50, Rev. A01