Page 1 of 1

IDE "Standard" ports vs PCI

Posted: Mon Mar 03, 2008 7:07 pm
by essial
I am to the point where I want to start working on IDE/ATAPI support. I have information on ATAPI that specifies fixed registers for primary and secondary controllers (0x1F0, 0x3F0, 0x170, and 0x370). Thats fine, however, in my PCI bus enumeration, the IDE control is reporting to have a single IO adress of 0x1050. Ubuntu booted on the same VM confirms that this is correct. What is the difference?

Posted: Mon Mar 03, 2008 8:10 pm
by iammisc
That is the Bus Master Control Registers. If the controller only has one BAR set, then it is usually in Compatibility mode(where it uses the standard ide ports). You can test the mode by reading the lowest byte of the 3-byte class code in the pci configuration space. Anyway, the BMCR registers are basically used for DMA from the PCI card. So you set up the BMCR registers and then do a command like READ DMA.

Just for completeness, if the controller is in native-pci mode, BAR0-BAR3 should contain the io addresses of the primary and secondary drive registers.

see
http://www.bswd.com/pciide.pdf
http://www.t13.org/Documents/UploadedDo ... lume_1.pdf
http://www.t13.org/Documents/UploadedDo ... lume_2.pdf
http://www.t13.org/Documents/UploadedDo ... lume_3.pdf

Oh yeah, and info about the BMCRS is available at the driver at http://ata-atapi.com/

Hope all that helps.

Posted: Mon Mar 03, 2008 9:52 pm
by essial
Thanks, thats exactly what I needed, now it makes sense!