Input and Output Requests

File system drivers and other clients use I/O requests to direct a device to carry out a given I/O operation. To submit a request, a client fills the members of an IOR structure (part of an IOP structure) and passes the address of the IOR to the IOS_SendCommand service. The IOS passes the IOR to the various drivers in the calldown chain. The IOS and device drivers update this structure as the request progresses through the chain. There are the following I/O requests:

IOR_ABORT_QUEUE (0x24)

Cancels queued requests.

IOR_CANCEL (0x03)

Cancels a previously issued command.

IOR_CLEAR_QUEUE (0x10)

Requests to clear NEC queues for device. Returns when queue is clear.

IOR_COMPUTE_GEOM (0x0C)

Determine device geometry information.

IOR_DOS_RESET (0x11)

Corresponds to INT 13h reset.

IOR_EJECT_MEDIA (0x08)

Ejects media.

IOR_FLUSH_DRIVE (0x27)

Flushes dirty data.

IOR_FLUSH_DRIVE_AND_DISCARD (0x28)

Flushes dirty data and discards queued data.

IOR_FORMAT (0x0E)

Formats a track.

IOR_FSD_EXT (0x29)

Sends prinvate data to FSD layer.

IOR_GEN_IOCTL (0x0D)

Carries out a generic I/O control function.

IOR_LOAD_MEDIA (0x07)

Loads media.

IOR_LOCK_MEDIA (0x09)

Locks media.

IOR_MEDIA_CHECK (0x05)

Gets disk change status.

IOR_MEDIA_CHECK_RESET (0x06)

Gets and resets disk change status.

IOR_READ (0x00)

Reads data from device.

IOR_REQUEST_SENSE (0x0B)

Returns drive sense data.

IOR_RESTART_QUEUE (0x23)

Restarts the queue in the same manner as the IOS queuing services.

IOR_SCSI_PASS_THROUGH (0x0F)

Passes a SCSI command through to device.

IOR_SCSI_REQUEST (0x12)

Request for SCSI device.

IOR_SET_WRITE_STATUS (0x22)

Sets write protect status.

IOR_SPIN_DOWN (0x25)

Directs the drive to stop spinning.

IOR_SPIN_UP (0x26)

Directs the drive to start spinning.

IOR_UNLOCK_MEDIA (0x0A)

Unlocks media.

IOR_VERIFY (0x02)

Verifies data on device.

IOR_WRITE (0x01)

Writes data to device.

IOR_WRITEV (0x04)

Writes and verifies data to device.


To generate a read request, for example, the client allocates an IOP using the ISP_CREATE_IOP service, fills the IOR with the data for the request, and passes the address of the IOR to the IOS_SendCommand service. The IOS passes the IOR to the volume tracker, which makes sure the correct media is loaded. The volume tracker passes the IOR to the disk TSD, which converts the volume relative address to a media relative address. The disk TSD passes the IOR to the port driver, which initiates a read operation at the device and returns control to the disk TSD. Throughout this process each driver that receives the IOR takes ownership of it. The port driver retains ownership of the IOR.

A client typically allocates the IOP by using the ISP_CREATE_IOP service. This ensures that the IOS can provide request time-out support and other services. The IOR is the only portion of the IOP that the client may access with the exception of the first 32-bit field of the IOP, which contains the 32-bit physical address of the IOP. The correct size for the IOP is contained in the VRP_max_req_size member in the VRP structure. The correct offset into the IOP of the IOR is the sum of the VRP_delta_to_ior member and the IOP address. A client can retrieve the VRP for a given device by using the IRS_GET_VRP function of the IOS_Requestor_Service service.

When the IOS receives an IOP, it sets the following IOP members:

IOP_physical_dcb

Address of the physical DCB

IOP_original_dcb

Address of the logical DCB

IOP_timer

Timeout value to 15 seconds

IOP_calldown_ptr

Address of the first layer in the calldown chain

IOP_callback_ptr

Address of IOS_iop_callback callback routine


After setting these members, the IOS calls the first layer in the calldown chain, typically the volume tracking driver. When the request is called back to IOS at IOS_iop_callback, contents of IOR_req_req_handle is placed on the stack, and IOR_callback is called.

See also IOP, IOR, IOS_SendCommand, VRP