Device driver function 04h Read B C
Read transfers data from a device into the specified buffer.
This function is required for both block and character device
drivers.
──────────────────────────────────────────────────────────────────
The driver must translate the logical-sector number supplied in
the rwrStartSec or rwrHugeStartSec field to the appropriate head,
track, and sector numbers.
The rwrHugeStartSec field is used only if bit 1 is set in the
dhAttributes field in the block device driver's DeviceHeader
structure.
──────────────────────────────────────────────────────────────────
rwrUnit
Specifies the device from which data is to be read. This field is
used for block device drivers only.
rwrStatus
Specifies the status of the completed function. If the function
was successful, the driver must set the done bit (bit 8).
Otherwise, the driver must set both the error and done bits (bits
15 and 8) and copy an error value to the low-order byte.
rwrMediaID
Specifies the media descriptor for the medium DOS assumes is in
the drive. This field is used for block device drivers only.
- See Media
rwrBuffer
Contains the 32-bit address of the buffer that receives the data
read from the device.
rwrBytesSec
Contains the number of bytes or sectors to read and receives the
number of bytes or sectors read.
input Specifies the number of bytes to read from a character
device, or the number of sectors to read from a block
device.
output Specifies the number of bytes read from a character
device, or the number of sectors read from a block
device. The driver must set this field; if there is an
error, the driver should return the number of bytes or
sectors read before the error occurred.
rwrStartSec
Specifies the first logical sector to read. If the first sector is
larger than 65,535 bytes, this field contains 0FFFFh and the
rwrHugeStartSec field specifies the first sector. This field is
used for block device drivers only.
rwrVolumeID
Contains the 32-bit address of a zero-terminated ASCII string
specifying the volume identifier for the disk most recently
accessed. If the driver returns error value 0Fh (invalid disk
change), DOS uses the volume identifier to prompt the user to
insert the appropriate disk. This field is used for block device
drivers only.
rwrHugeStartSec
Specifies the first logical sector to read. This field is used
only if the rwrStartSec field contains 0FFFFh. This field is used
for block device drivers only.