PCI IDE Controller: Difference between revisions

m
Changed "drive" to "controller"
[unchecked revision][unchecked revision]
m (moved IDE to PCI IDE Controller: All of the information in the article applies only to PCI IDE Controllers, not legacy IDE controllers.)
m (Changed "drive" to "controller")
Line 40:
 
===Detecting an IDE drive===
Each IDE drivecontroller appears as a device on the [[PCI]] bus. If the class code is 0x01 (Mass Storage Controller) and the subclass code is 0x1, (IDE) this device is an IDE Device.
The IDE device only uses five BARs out of the six
* BAR0: Base address of primary channel (I/O space), if it is 0x0 or 0x1, the port is 0x1F0.
Line 48:
* BAR4: Bus Master IDE; refers to the base of I/O range consisting of 16 ports. Each 8 ports controls DMA on the primary and secondary channel respectively.
 
A parallel IDE drivecontroller will use IRQs 14 and 15; a serial IDE uses only one IRQ. To read this IRQ, we look through the device's PCI configuration space:
<source lang="c">
outl((1 << 31) | (bus << 16) | (device << 11) | (func << 8) | 8, 0xCF8); // Send the parameters.
Anonymous user