mov bx, Drive ;0 = default, 1 = A, 2 = B, etc.
mov ch, 08h ;device category (must be 08h)
mov cl, 62h ;Verify Track on Logical Drive
mov dx, seg VerifyBlock
mov ds, dx
mov dx, offset VerifyBlock ;ds:dx points to FVBLOCK structure
mov ax, 440Dh ;IOCTL for Block Device
int 21h
jc error_handler ;carry set means error
Verify Track on Logical Drive (Function 440Dh Minor Code 62h) verifies a track on the specified device.
Drive
Specifies the drive on which the track is to be verified (0 = default drive, 1 = A, 2 = B, etc.).
VerifyBlock
Points to an FVBLOCK structure that specifies the head and cylinder to verify. The FVBLOCK structure has the following form:
FVBLOCK STRUC
fvSpecFunc db 0 ;special functions (must be zero)
fvHead dw ? ;head to format/verify
fvCylinder dw ? ;cylinder to format/verify
FVBLOCK ENDS
For a full description of the FVBLOCK structure, see Chapter 3, “File System.”
If the function is successful, the carry flag is clear. Otherwise, the carry flag is set and the AX register contains an error value, which may be one of the following:
Value | Name |
0001h | ERROR_INVALID_FUNCTION |
0002h | ERROR_FILE_NOT_FOUND |
0005h | ERROR_ACCESS_DENIED |
Verify Track on Logical Drive returns 0002h (ERROR_FILE_NOT_FOUND) if the specified drive number is invalid.
Function 440Dh Minor Code 42h Format Track on Logical Drive