Alright, in Bochs 2.3.7, I wrote a simple PCI implementation. It gets information about various devices connected to the PCI bus.
After running Linux to get the valid PCI device information I compared it with what my PCIGetDeviceInfo() function is returning.
Everything is valid except for bus 0, card 1, function 1.
It claims that the command register is 1 when it should be 5.
My OS: http://i.imgur.com/UXEA2.png
Linux : http://i.imgur.com/PQxeN.png
It appears to be the only time that my PCIGetDeviceInfo() function refuses to work.
Code (Please, excuse the hackishness of it, in the current state, I know it's painful to look at):
http://pastebin.com/PibQKchW
Any idea what's wrong?
We're at a loss here.
PCI in Bochs
Re: PCI in Bochs
Hi,
Basically, your code is right, but your OS doesn't enable bus mastering on this ATA controller.
Cheers,
Brendan
The only difference in the command register is bit 2, which is used to enable/disable the device's ability to act as a bus master. It looks like Linux enables bus mastering (and the BIOS doesn't for backward compatibility). You might have also noticed that the value for "interface" is also different for this device (in Linux its 0x80 while in yours it's 0x00), where bit 7 is used by the device to indicate that it's currently configured for bus mastering.AUsername wrote:Alright, in Bochs 2.3.7, I wrote a simple PCI implementation. It gets information about various devices connected to the PCI bus.
After running Linux to get the valid PCI device information I compared it with what my PCIGetDeviceInfo() function is returning.
Everything is valid except for bus 0, card 1, function 1.
It claims that the command register is 1 when it should be 5.
Basically, your code is right, but your OS doesn't enable bus mastering on this ATA controller.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.