Read_Sectors

This function reads the data from one or more sectors on the specified drive into the buffer provided.


#include <lvm_intr.h>

void _System Read_Sectors (

    CARDINAL32   Drive_Number,      /* (I) Number of the drive to read (starting from 1) */
    LBA          Starting_Sector,   /* (I) The first sector to read (starting from 0) */
    CARDINAL32   Sectors_To_Read,   /* (I) The number of sectors to read */
    ADDRESS      Buffer,            /* (O) Buffer to receive the read data */
    CARDINAL32 * Error              /* (O) Address where the error code will be stored */

);

Parameters

Drive_Number
The number of the hard drive to read from. The drives in the system are numbered from 1 to n, where n is the total number of hard drives in the system.
Starting_Sector
The number of the first sector to read from. The sectors on a drive are numbered starting from 0.
Sectors_To_Read
The number of sectors to read into memory.
Buffer
The location to put the data read into.
Error
The address of a CARDINAL32 in which to store an error code should an error occur.

Returns

N/A.

Errors

If an error occurs, the value pointed to by Error will be > 0, and the contents of Buffer will be undefined.

Side Effects

Data may be read into memory starting at Buffer.

Notes

Buffer must be large enough to hold the number of sectors requested. The size of one sector is defined as BYTES_PER_SECTOR (512) bytes.

16-Bit Equivalent:

void _Far16 _Pascal _loadds READ_SECTORS16(
        CARDINAL32          Drive_Number,
        LBA                 Starting_Sector,
        CARDINAL32          Sectors_To_Read,
        ADDRESS      _Seg16 Buffer,
        CARDINAL32 * _Seg16 Error
);