hello! I have another question for you all
some time ago I wrote code for PCI enumeration but now I have the doubt it doesn't find all the devices.
On bochs it finds these 4 devices:
device 0: class 0x6 ; sub class 0x0 ; bus=0 ; device=0 function=0
device 1: class 0x6 ; sub class 0x1 ; bus=0 ; device=1 function=0
device 2: class 0x1 ; sub class 0x1 ; bus=0 ; device=1 function=1
device 3: class 0x6 ; sub class 0x80 ; bus=0 ; device=1 function=3
I tried also on vmware and it finds 42 devices (but 33 of those are PCI to PCI bridges)
In both the emulators I don't get any processor.
I get the same result using the brute force method and the recusrive method.
So here's the question: is this the correct result or I should have found something else?
PCI enumeration results
Re: PCI enumeration results
Well I know when I run my PCI Bus scanning code in Bochs, I get only two devices. I was only scanning bus 0 at the time. And found lots of devices were not showing up. So I changed my code and scanned bus 0-7 (8 total) and found the remaining devices. You want to make sure the Vender ID isnt 0xFFFF and the Device ID isnt 0xFFFF. That should help, If you don't check the VenderID and the DeviceID you can get all kinds of weird things. I would also check the wiki: http://wiki.osdev.org/PCICR wrote:hello! I have another question for you all
some time ago I wrote code for PCI enumeration but now I have the doubt it doesn't find all the devices.
On bochs it finds these 4 devices:
device 0: class 0x6 ; sub class 0x0 ; bus=0 ; device=0 function=0
device 1: class 0x6 ; sub class 0x1 ; bus=0 ; device=1 function=0
device 2: class 0x1 ; sub class 0x1 ; bus=0 ; device=1 function=1
device 3: class 0x6 ; sub class 0x80 ; bus=0 ; device=1 function=3
I tried also on vmware and it finds 42 devices (but 33 of those are PCI to PCI bridges)
In both the emulators I don't get any processor.
I get the same result using the brute force method and the recusrive method.
So here's the question: is this the correct result or I should have found something else?
Hope it helps, Matt
Now far as finding a processor, I think sometimes there is one and sometimes there isn't one. Oddly enough. I can't remeber if my current code finds the processor in VMWare but I know on my AMD64 FX processor it finds it.
Re: PCI enumeration results
Well, it is consistent with what FreeBSD detects when run in VMWare, so I believe it is fine.CR wrote: I tried also on vmware and it finds 42 devices (but 33 of those are PCI to PCI bridges)
Re: PCI enumeration results
ok, so I assume my code is correct!
thank you!
thank you!
Re: PCI enumeration results
oh, no, your code is not correct! sorry...CR wrote:ok, so I assume my code is correct!
thank you!
some pci buses may mirror the device you found, specially for vmware,
say, if you got device id from 1-16, bus may mirror it from 17-32, so you will see totally 32 devices,in fact, it is only 16 device on bus, you should remove the others which was mirrored by bus, these mirrored device was so called ghost device in linux kernel. you can search linux kernel source code and find out the way to fix up your code.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: PCI enumeration results
It is. VMWare just has a huge load of never-used bridge devices. You on the other hand should probably be fixing your code if it has duplicate devices.virusest wrote:oh, no, your code is not correct! sorry...CR wrote:ok, so I assume my code is correct!
thank you!
Re: PCI enumeration results
You won't find any normal processor on the PCI, except if you got some special extension board. Even for "system on board" it is not reported as a processor.CR wrote:In both the emulators I don't get any processor.
You might got mixed up with ACPI, which indeed report processor(s) and cores.