Function 440Dh Minor Code 68h Sense Media Type

mov bx, Drive ;0 = default, 1 = A, 2 = B, etc.

mov ch, 08h ;device category (must be 08h)

mov cl, 68h ;Sense Media Type

mov dx, seg Media

mov ds, dx

mov dx, offset Media ;ds:dx points to buffer for media type

mov ax, 440Dh ;IOCTL for Block Device

int 21h

jc error_handler ;carry set means error

Sense Media Type (Function 440Dh Minor Code 68h) returns the media type for the specified block device.

Parameters

Drive

Specifies the drive for which parameters are requested (0 = default drive, 1 = A, 2 = B, etc.).

Media

Points to a 2-byte buffer that receives information on the media type for the given drive. The buffer has the following form:

Offset Description

00h Receives a value specifying whether the media type is the default value. This byte is set to 01h for the default media type and to 00h for any other media type.
01h Receives a value specifying the media type. This byte is set to 02h for 720K disks, 07h for 1.44-MB disks, and 09h for 2.88-MB disks.

Return Value

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
0005h ERROR_ACCESS_DENIED

This function may also return a device-dependent error value as specified by the device driver.

Comment

Sense Media Type returns 0005h (ERROR_ACCESS_DENIED) if the media type for the specified drive cannot be determined or the given drive is not ready. Programs can use Get Extended Error (Function 59h) to retrieve additional information about the error.