An application program requests an I/O operation from MS-DOS by loading registers with the appropriate values and executing an Int 21H. This results in the following sequence of actions:
1.MS-DOS inspects its internal tables and determines which device driver should receive the I/O request.
2.MS-DOS creates a request-header data packet in a reserved area of memory. (Disk I/O requests are transformed from file and record information into logical-sector requests by MS-DOS's interpretation of the disk directory and FAT.)
3.MS-DOS calls the device driver's strat entry point, passing the address of the request header in the ES:BX registers.
4.The device driver saves the address of the request header in a local variable and performs a FAR RETURN.
5.MS-DOS calls the device driver's intr entry point.
6.The interrupt routine saves all registers, retrieves the address of the request header that was saved by the strategy routine, extracts the function code, and branches to the appropriate command-code subroutine to perform the function.
7.If a data transfer on a block device was requested, the driver's read or write subroutine translates the logical-sector number into a head, track, and physical-sector address for the requested unit and then performs the I/O operation. Because a multiple-sector transfer can be requested in a single request header, a single request by MS-DOS to the driver can result in multiple read or write commands to the disk controller.
8.When the requested function is complete, the interrupt routine sets the status word and any other required information into the request header, restores all registers to their state at entry, and performs a FAR RETURN.
9.MS-DOS translates the driver's return status into the appropriate return code and carry-flag status for the MS-DOS Int 21H function that was requested and returns control to the application program.
Note that a single request by an application program can result in MS-DOS passing many request headers to the driver. For example, attempting to open a file in a subdirectory on a previously unaccessed disk drive might require the following actions:
Reading the disk's boot sector to get the BPB
Reading from one to many sectors of the root directory to find the entry for the subdirectory and obtain its starting-cluster number
Reading from one to many sectors of both the FAT and the subdirectory itself to find the entry for the desired file