HOWTO: Access IDE Controller Registers Using IDE Passthrough

ID: Q196550

The information in this article applies to:

SUMMARY

Windows 95 device driver programmers can use the IOS IOR_IDE_PASS_THROUGH command to directly access an IDE disk controller's command and control registers, if using Windows 95 Version B (also known as OSR2) or later.

MORE INFORMATION

The support for this command is provided in the IDE port driver, ESDI_506.pdr.

IDE Passthrough support was added to accommodate the Vendor-Supplied Driver Smartvsd.vxd (Self-Monitoring Analysis and Reporting Technology) that resides in the IOS layered driver hierarchy.

The latest ESDI_506.pdr driver for Windows 95 can be found at the following location:

   http://support.microsoft.com/support/downloads/dp2884.asp

Alternatively, perform a device driver search for ESDI_506.pdr or Remideup.exe.

NOTE: This driver is available for download by the end user, not for distribution by the developer. This policy helps ensure a single control point for device driver versions.

Following are the general IOP specifications for the IDE Passthrough command that is processed by the IDE port driver ESDI_506.pdr.

On request calldown, the following IOP fields should be completed, as well as the DCB fields and other normally completed fields. The IOP, IDE register structure, and buffer must be locked. Register EBX must point to the BDD portion of the DCB (DCB_bdd) when IOS_SendCommand is called with a passthrough request:

IOR_func:

   IOR_IDE_PASS_THROUGH (0x2B)

IOR_buffer_pointer:

   linear buffer pointer if data transfer is to occur.

IOR_xfer_count:

   transfer length if the command involves transfer of data (0 if none).

IOR_requestor_usage[0]:

   Initially contains the seven parameters to send to be written to the IDE
   task file (command and control registers). When the port driver
   completes, this field contains the end-of-command values of the task
   file registers.

typedef struct _IDEREGS {

   BYTE  bFeaturesReg;     // Used for specifying DFP "sub commands".
   BYTE  bSectorCountReg;  // IDE sector count register.
   BYTE  bSectorNumberReg; // IDE sector number register.
   BYTE  bCylLowReg;       // IDE low order cylinder value.
   BYTE  bCylHighReg;      // IDE high order cylinder value.
   BYTE  bDriveHeadReg;    // IDE drive/head register.
   BYTE  bCommandReg;      // Actual IDE command. Checked for validity by
                              driver.

} IDEREGS, *PIDEREGS, *LPIDEREGS;

IOR_flags:

   IORF_DATA_IN if reading from drive, IORF_DATA_OUT if writing to drive.
   Neither should be set if no data is transferred. Also set the following
   flags: IORF_HIGH_PRIORITY, IORF_SYNC_COMMAND, and IORF_VERSION_002.

IOR_next, IOR_start_addr[2], IOR_req_vol_handle:

   Set these fields to zero.

IOR_vol_designtr:

   Set equal to DCB_unit_number. Physical unit (0x80) based.

On request callback, the task file register structure, is updated to reflect each value in the task file. Good IOR_STATUS= IORS_SUCCESS is always returned for passthrough requests.

You can find specifications for SMART IDE at the ring 3 (application) level on the following Web site:

   http://www.microsoft.com/hwdev/respec/storspec.htm

NOTE: If the IDE port driver is not loaded, then SMARTVSD does not load. Any attempt by an application to open SMARTVSD then fails.

Additional query words:

Keywords          : kbDDK kbStorageDev kbWinOS95 kbWinOS98 
Hardware          : x86
Issue type        : kbhowto

Last Reviewed: December 3, 1998