Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- DOS 5.0 Ref. - <b>device driver function 04h read b c</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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.

See Also: ReadWriteRequest Dev01h Dev08h 3Fh Media DeviceHeader Dev*

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson