Home |
The ISO 9660 File System Structure The exFAT File System Structure RTFiles-32 in Embedded Applications IDE Disk Driver |
IDE Disk DriverThe IDE driver requires 1, 2, 3, or 4 IDE controllers (channels), each of which may have one or two devices attached, and up to 4 Serial ATA ports. By default, the controllers are assumed to use the following resources in standard I/O mode:
The driver will operate disks, CDs, and DVDs in Multiword-DMA or Ultra-DMA mode if the following conditions are met:
If the I/O buffer supplied by the application in an I/O request is not at least WORD aligned and device flag RTF_DEVICE_NO_DIAG_MSG has not been set, the driver will display warning message: DrvIde: using intermediate sector buffer due to misaligned buffer using function RTFDiagMessage. The driver will then use an intermediate and aligned buffer allocated dynamically from the heap. The use of the intermediate buffer can have a negative effect on the application's performance. The IDE disk driver's ReadSectors function (which can be called through RTFRawRead) returns the 512 byte ATA Disk Identify structure when sector number (RTFSector)-1 is specified and exactly one sector is read. RTFDevice.DeviceTypeRTFDevice.DeviceType must be set to RTF_DEVICE_FDISK for this driver. RTFDevice.DeviceNumberThis field can assume values 0 to 7 for Parallel ATA interfaces or 8 to 11 for Serial ATA ports. Device 0 is the master device on the first (primary) Parallel ATA controller, device 1 is the slave on the first Parallel ATA controller, device 2 is the master device on the second (secondary) Parallel ATA controller, etc. Device number 8 is the first Serial ATA port. RTFDevice.DeviceFlagsApart from device independent device flags documented in section Device List, the following flags can be specified for RTFDevice.DeviceFlags: RTF_16_BIT_IOInstructs the driver to use 16-bit I/O instructions to communicate with the device when not operating in DMA mode. RTF_16_BIT_IO is assumed by default for disk controllers not located on a PCI bus. RTF_32_BIT_IOInstructs the driver to use 32-bit I/O instructions to communicate with the device when not operating in DMA mode. This setting will not work for PCMCIA disks. RTF_32_BIT_IO is assumed by default for disk controllers located on a PCI bus. RTF_NO_MULTI_SECTORWhen operating in PIO mode, the IDE driver will transfer several sectors (typically 8 or 16) per command to/from the IDE device, depending on the disk's capabilities. If you experience compatibility problems, you can set this flag to disable multi-sector I/O. RTF_NO_WRITE_CACHEBy default, the IDE driver uses the delayed write cache capability of modern IDE disks for best performance. RTFShutDown will ensure that this cache is flushed at program termination. Specify this flag to disable the delayed write cache. RTF_NO_UDMAThis flag can be used to prevent the driver from using any Multiword- or Ultra-DMA mode. Specify RTF_NO_UDMA if you experience compatibility problems. RTF_SATA_SLAVEInstructs the driver to access the Slave device on an SATA port. This flag is only evaluated for DeviceNumber 8 or higher. SATA controllers do not have Master and Slave devices, but some BIOS IDE emulations do implement Slave disks. The IDE driver is not reentrant within one channel/controller, but is reentrant for separate channels/controllers. Thus, device flag RTF_DEVICE_NEW_LOCK can be specified on every even device number and for all device numbers greater than 7 which do not specify flag RTF_SATA_SLAVE. RTFDevice.DriverThis field must point to RTFDrvIDE. RTFDevice.DriverDataThe IDE disk driver requires a pointer to a structure of type RTFDrvIDEData for RTFDevice.DriverData with the following layout: typedef struct { void * Obsolete1; UINT Obsolete2; UINT PortBase; UINT Obsolete3; UINT DiskTimeout; UINT ControllerTimeout; UINT IRQ; ... } RTFDrvIDEData; RTFDrvIDEData.PortBase is the base I/O address of the IDE controller. If set to 0, the driver will use addresses 01F0h, 0170h, 00F0h, and 0070h for IDE controllers 1, 2, 3, and 4, respectively. This value is ignored for Serial ATA ports. RTFDrvIDEData.DiskTimeout and RTFDrvIDEData.ControllerTimeout default to 5000 and 200 milliseconds if initialized to 0. ControllerTimeout is the maximum time the driver will wait for the IDE controller to accept a command. DiskTimeout is used for read and write operations. RTFDrvIDEData.IRQ defaults to 14, 15, 11, and 10 (for controllers 0, 1, 2, and 3) if set to 0. If you want to specify IRQ 0, set this field to -1. This value is ignored for Serial ATA ports. The other fields of RTFDrvIDEData are for the driver's internal use and should be left uninitialized or initialized to 0.
|