Function 58, subfunction 8 - LBA-read from device.
Parameters:
- eax = 58 - function number
- ebx = pointer to the information structure
Format of the information structure:
- +0: dword: 8 = subfunction number
- +4: dword: number of block to read (beginning from 0)
- +8: dword: ignored (set to 1)
- +12 = +0xC: dword: pointer to buffer for data (512 bytes)
- +16 = +0x10: dword: pointer to buffer for system operations
(4096 bytes)
- +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
/rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
1≤n≤4 - number of device: 1=IDE0, ..., 4=IDE3.
Instead of digits it is allowed, though not recommended for
convenience of transition to future extensions, to use
'first','second','third','fourth'.
Returned value:
- for device name /hd/xxx, where xxx is not in the list above:
- for invalid device name (except for the previous case):
- eax = 5
- ebx does not change
- if LBA-access is disabled by subfunction 11 of function 21:
- for ramdisk: attempt to read block outside ramdisk
(18*2*80 blocks) results in
- for successful read:
Remarks:
- Block size is 512 bytes; function reads one block.
- Do not depend on returned value, it can be changed
in future versions.
- Function requires that LBA-access to devices is enabled by
subfunction 11 of function 21. To check this one can use
subfunction 11 of function 26.
- LBA-read of floppy is not supported.
- Function reads data on physical hard drive; if for any reason
data of the concrete partition are required, application must
define starting sector of this partition (either directly
through MBR, or from the full structure returned by
подфункцией 11 функции 18).
- Function does not check error code of hard disk, so request of
nonexisting sector reads something (most probably it will be
zeroes, but this is defined by device) and this is considered
as success (eax=0).