User`s guide
Note: the CCP automatically discards all pending physical data buffers when it
receives control following a system warm start. However, the BDOS file system
automatically makes a Flush Buffers call in the Close File function. Thus, it is suffi-
cient to close a file to ensure that all pending physical buffers for that file are written
to the disk.
2.3.10 Multi-Sector I/O
CP/M 3 can read or write multiple 128-byte records in a single BDOS function
call. This process, called multi-sector I/O, is useful primarily in sequential read and
write operations, particularly on drives with physical record sizes larger than 128
bytes. In a multi-sector I/O operation, the BDOS file system bypasses, when possible,
all intermediate record buffering. Data is transferred directly between the TPA and
the drive. In addition, the BDOS informs the BIOS when it is reading or writing
multiple physical records in sequence on a drive. The BIOS can use this information
to further optimize the I/O operation resulting in even better performance. Thus, the
primary objective of multi-sector I/O is to improve sequential I/O performance. The
actual improvement obtained, however, depends on the hardware environment of the
host system, and the implementation of the BIOS.
The number of records that can be supported with multi-sector I/O ranges from 1
to 128. This value can be set by BDOS function 44, Set multi-sector Count. The
multi-sector count is set to one when a transient program begins execution. However,
the CP/M 3 LOADER module executes with the multi-sector Count set to 128 unless
the available TPA space is less than 16K. In addition, the CP/M 3 PIP utility also
sets the multi-sector count to 128 when sufficient buffer space is available. Note that
the greatest potential performance increases are obtained when the multi-sector count
is set to 128. Of course, this requires a 16K buffer.
The multi-sector count determines the number of operations to be performed by
the following BDOS functions:
o Sequential Read and Write functions
o Random Read and Write functions including Write Random with Zero Fill
If the multi-sector count is N, calling one of the above functions is equivalent to
making N function calls. If a multi-sector I/O operation is interrupted with an error
such as reading unwritten data, the file system returns in register H the number of
128-byte records successfully processed.
2-26
2.3 BDOS File System CP/M 3 Programmer's Guide