Device driver function 01h      Media Check             B

Media Check determines whether the medium in the specified drive
has changed.

This function is required by block device drivers only.

──────────────────────────────────────────────────────────────────

If the medium in the drive has not changed, DOS proceeds with the
disk operation.

If the medium in the drive has changed, DOS invalidates all
buffers associated with the drive, including any buffers
containing data waiting to be written (this data is lost). DOS
then calls Build BPB (device driver function 02h) to request a BPB
structure for the new disk and reads the disk's file allocation
table (FAT) and directory.

If the driver cannot determine whether the disk has changed, DOS
checks its internal buffers. If data is waiting to be written to
the disk, the system assumes that the disk has not changed and
attempts to write the data to the disk. If the disk buffers are
empty, DOS assumes the disk has changed and updates the disk
information as if the driver had returned 0FFh (mrReturn).

──────────────────────────────────────────────────────────────────

mrUnit
Specifies the unit for which the medium is to be checked.


mrStatus
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.


mrMediaID
Specifies the media descriptor for the medium DOS assumes is in
the drive.
- See Media


mrReturn
Receives a return value identifying whether the medium has
changed. The driver must set the field to one of the following
values:
0FFh Medium has been changed
00h Driver cannot determine whether
medium has been changed
01h Medium is unchanged


mrVolumeID
Receives the 32-bit address (segment:offset) of a zero-terminated
ASCII string specifying the volume identifier of the previous disk
in the drive. The driver must set this field to the address of the
volume identifier. If the disk does not have a volume identifier,
the driver must set the field to the address of the string
"NO NAME".