PCI IDE Controller: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
Line 53:
* Secondary Master Drive [Port 3 or Port 4], also called [SATA3] in BIOS Setup Utility.
* Secondary Slave Drive [Port 3 or Port 4], also called [SATA4] in BIOS Setup Utility.
 
===Detecting an IDE===
Please if you wanna support only the Parallel IDE, skip the part of [Detecting an IDE].
Each IDE appears as a device [in PCI World, it is called a function] on PCI Bus. If you don't know about PCI, please refer to [http://wiki.osdev.org/PCI PCI].
When you find a device on PCI, you should determine whether it is an IDE Device or not, this is determined according to Class Code and Subclass code.
If Class code is: 0x01 [Mass Storage Controller] and Subclass Code is: 0x01 [IDE], so this device is an IDE Device.
We know all that each PCI Device has 6 BARs, ok, only 5 BARs are used by IDE Device:
* BAR0: Base Address of Primary Channel I/O Ports, if it is 0x0 or 0x1, this means [0x1F0].
* BAR1: Base Address of Priamry Channel Control Ports, if it is 0x0 or 0x1, this means [0x3F4].
* BAR2: Base Address of Secondary Channel I/O Ports, if it is 0x0 or 0x1, this means [0x170].
* BAR3: Base Address of Secondary Channel Control Ports, if it is 0x0 or 0x1, this means [0x374].
* BAR4: Bus Master IDE, this I/O Address refers to the base of I/O range consists of 16 ports, each 8 ports controls DMA on a channel.
 
IRQs are really a problem for IDEs, because the IDE uses IRQs 14 and 15, if it is a Parallel IDE.
If it is a Serial IDE, it uses another IRQ and only one IRQ, but how does we know the IRQs used by IDE? In Quafios it is quite easy: