IDE "Standard" ports vs PCI

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
essial
Member
Member
Posts: 26
Joined: Sat Mar 01, 2008 10:23 pm

IDE "Standard" ports vs PCI

Post 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?
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post 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.
essial
Member
Member
Posts: 26
Joined: Sat Mar 01, 2008 10:23 pm

Post by essial »

Thanks, thats exactly what I needed, now it makes sense!
Post Reply