PCI IDE Controller: Difference between revisions
[unchecked revision] | [unchecked revision] |
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:
|
Revision as of 10:39, 8 November 2009
IDE is a keyword points to the semi-conductors on the mother-board that controls ATA Drives(like ATA Hard-Disks). ATA (AT-Attachment) is the interface of this drives. IDE also can be an IDE card connected to PCI.
ATAPI is an extension to ATA. ATAPI (ATA Packet Interface) adds the support of Drives wich uses SCSI Command-Set (like ODDs (Optical Disk Drives .e.g CD-ROMs, DVD-ROMs), Tape Drives, and ZIP Drives).
Parallel/Serial ATA/ATAPI
IDE can allow even 4 drives to be connected to. Each drive may be:
- 1. Parallel AT-Attachment [PATA]: Like PATA HDDs.
- 2. Parallel AT-Attachment Packet-Interface [PATAPI]: Like PATAPI ODDs.
- 3. Serial ATA [SATA]: Like SATA HDDs.
- 4. Serial ATAPI [SATAPI]: Like SATAPI ODDs.
We can ignore Tape Drives and ZIP Drives as they are obseleted. The Way of accessing ATA Drives is one, means that the way of accessing PATA HDDs is the same of SATA HDDs. also the way of accessing PATAPI ODDs is the same of SATAPI ODDs. For that, for IDE Device Driver, it is not required to know if a drive is Parallel or Serial, but it is important to know if it is ATA or ATAPI.
IDE Interface
If you open your case and look at the mother board, we will see a port or two like these in the picture to the right.
The white and green ports are IDE Ports, each port of them is called channel. so there is:
- Primary IDE Channel.
- Secondary IDE Channel.
These Ports allows only Parallel Drives to be connected to, means that it supports only PATA/PATAPI Drives.
Each Port can has a PATA cable connected to, it is like this in the photo to the right. One master drive, or two drives [Master and Slave] can be connected to one PATA Cable.
So we can have:
- Primary Master Drive.
- Primary Slave Drive.
- Secondary Master Drive.
- Secondary Slave Drive.
Each Drive May be: PATA or PATAPI.
But What about Serial IDE?
Almost many of modern motherboards have a Serial IDE which allows SATA and SATAPI Drives to be connected to.
Serial IDE Ports are 4, like these appear in the photo to the right, Each Port is conducted with a Serial ATA (SATA) Cable.
So from the pictures we can understand that only one drive can be connected to Serial IDE Port, each two ports make a channel, and also Serial IDE has:
- Primary Master Drive [Port1, or Port 2], also called [SATA1] in BIOS Setup Utility.
- Primary Slave Drive [Port 1 or Port 2], also called [SATA2] in BIOS Setup Utility.
- 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 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: