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.
I'm scanning the bus for IDE mass storage devices. I can find (some) and get the vendor id's and prog_if etc., but the base address registers all show as zero.
The mass storage controller is being detected as class and subclass 0x01.
I'm using VMware and bochs alternately, and I noticed that the prog_if registers read 0x80 and 0x8a - corresponding to ISA compatibility modes and not PCI modes.
I tried writing 0x8f (PCI native mode controller) as a dword to offset 0x08 but it had no effect on the BAR registers.
How can I get to read these base address registers?
Each IDE controller 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.
BAR1: Base address of primary channel control port (I/O space), if it is 0x0 or 0x1, the port is 0x3F6.
BAR2: Base address of secondary channel (I/O space), if it is 0x0 or 0x1, the port is 0x170.
BAR3: Base address of secondary channel control port, if it is 0x0 or 0x1, the port is 0x376.
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.
The Wiki page is wrong. The only correct way to determine if a channel is in compatibility mode is by inspecting the Programming Interface register. If it is, the corresponding BARs must be ignored.
I've updated that section of the wiki with information from the actual PCI IDE specifications. I have to wonder where that nonsense originally came from...
Octocontrabass wrote:I've updated that section of the wiki with information from the actual PCI IDE specifications. I have to wonder where that nonsense originally came from...
The contended section was added to the page by the page's creator, Mostafazzio, on November 8, 2009. No edit comment there; they didn't seem to be too fond of those. So no clue about their sources.