|
| |
INPUT / OUTPUT
command codes = 3, 4, 8, 9, and 12
ES:BX pointer to request header. Format:
length field
byte media descriptor byte
dword transfer address (buffer address)
word byte/sector count
dword (DOS 3.x) pointer to the volume ID if
error code 0Fh is returned
The driver must perform the following:
A) set the status word in the request header
B) perform the requested function
C) set the actual number of sectors or bytes
tranferred
NOTE: No error checking is performed on an IOCTL I/O call.
However the driver must set the return sector or byte count
to the actual number of bytes transferred.
The following applies to block device drivers:
Under certain circumstances the device driver may be asked to do
a write operation of 64k bytes that seems to be a *wrap around*
of the transfer address in the device driver request packet. This
arises due to an optimization added to write code in DOS. It will
only happen in writes that are within a sector size of 64k on
files that are being exetended past the current end of file. It
is allowable for the device driver to ignore the balance of the
write that wraps around, if it so chooses. For example, a write
of 10000h bytes worth of sectors with a transfer address of
XXXX:1 ignores the last two bytes.
Remember: A program that uses DOS function calls can never
request an input or output function of more than 0FFFFh
bytes, therefore, a wrap around in the transfer
(buffer) segment can never occur. It is for this reason
you can ignore bytes that would have wrapped around in
the tranfer segment.
If the driver returns an error code of 0Fh (invalid disk change)
it must put a DWORD pointer to an ASCIIZ string which is the
correct volume ID to ask the user to reinsert the disk.
DOS 3.x:
The reference count of open files on the field (maintained by the
OPEN and CLOSE calls) allows the driver to determine when to
return error 0Fh. If there are no open files (reference count=0)
and the disk has been changed, the I/O is all right, and error
0Fh is not returned. If there are open files (reference count >
0) and the disk has been changed, an error 0Fh condition may
exist. |