User`s guide
The BDOS file system uses the CP/M 3 system date and time when it records a
date and time stamp. This value is maintained in a field in the System Control Block
(SCB). On CP/M 3 systems that support a hardware clock, the BIOS module directly
updates the SCB system date and time field. Otherwise, date and time stamps record
the last initialized value for the system date and time. The CP/M 3 DATE utility can
be used to set the system date and time.
2.3.9 Record Blocking and Deblocking
Under CP/M 3, the logical record size for disk I/O is 128 bytes. This is the basic
unit of data transfer between the operating system and transient programs. However,
on disk, the record size is not restricted to 128 bytes. These records, called physical
records, can range from 128 bytes to 4K bytes in size. Record blocking and deblock-
ing is required on systems that support drives with physical record sizes larger than
128 bytes.
The process of building up physical records from 128 byte logical records is called
record blocking. This process is required in write operations. The reverse process of
breaking up physical records into their component 128 byte logical records is called
record deblocking. This process is required in read operations. Under CP/M 3, record
blocking and deblocking is normally performed by the BDOS.
Record deblocking implies a read-ahead operation. For example, if a transient
program makes a BDOS function call to read a logical record that resides at the
beginning of a physical record, the entire physical record is read into an internal
buffer. Subsequent BDOS read calls for the remaining logical records access the
buffer instead of the disk. Conversely, record blocking results in the postponement
of physical write operations but only for data write operations. For example, if a
ransient program makes a BDOS write call, the logical record is placed in a buffer
equal in size to the physical record size. The write operation on the physical record
t
buffer is postponed until the buffer is needed in another I/O operation. Note that
under CP/M 3, directory write operations are never postponed.
Postponing physical record write operations has implications for some applications
programs. For those programs that involve file updating, it is often critical to guar-
antee that the state of the file on disk parallels the state of the file in memory after
the update operation. This is only an issue on systems where physical write opera-
tions are postponed because of record blocking and deblocking. If the system should
crash while a physical buffer is pending, data would be lost. To prevent this loss of
data, the BDOS Flush Buffers function, function 48, can be called to force the write
of any pending physical buffers.
2-25
2.3 BDOS File System CP/M 3 Programmer's Guide