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.
As far as I can tell, it should work (for a limited definition of "work" - e.g. assuming there's no problems caused by not caring if the device actually exists or not, and not caring if the device supports multiple functions or not).
You could try putting " _print_int(t); _printf(" ");" just before the "if(t==1)" so that it shows you all the base class codes it does see. That might give some hint at what is going wrong.
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.
No luck. i did that but it kept on printing 17 or 0x11 which is Data Acquisition and Signal Processing Controllers
one more thing. after enumeration the function told that it found 10890 devices (by checking device id).
is it abnormal? i think so.
hegde1997 wrote:No luck. i did that but it kept on printing 17 or 0x11 which is Data Acquisition and Signal Processing Controllers
one more thing. after enumeration the function told that it found 10890 devices (by checking device id).
is it abnormal? i think so.
That makes me think the problem is in "pci_configread32()". Can you post a disassembly of this function?
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.
hegde1997 wrote:No luck. i did that but it kept on printing 17 or 0x11 which is Data Acquisition and Signal Processing Controllers
one more thing. after enumeration the function told that it found 10890 devices (by checking device id).
is it abnormal? i think so.
That makes me think the problem is in "pci_configread32()". Can you post a disassembly of this function?
Cheers,
Brendan
public pci_configread32
pci_configread32 proc near
This code looks like it was generated with optimisation disabled; but somehow the "offset & 0x000000FC" part is missing. It is correct though, and the "offset & 0x000000FC" part isn't necessary (as nothing calls this function with strange values for offset).
I changed it but not much difference. I think there is something wrong somewhere else.
"Not much difference" means that there was some difference.
I think you need to post the current code (as the code you originally posted wasn't your current code at the time, and you've made other changes like checking if the device is valid and fixing "outl" since then); and also post the current results (e.g. how many devices of which classes it detects now).
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.
This code looks like it was generated with optimisation disabled;
The code looks spoofed. The input code shown uses GCC specifics, while the output is some TASM lookalike with the aforementioned compiler errors. Furthermore, the same output contains names for locals yet does not contain offset values, both of which are signature features of a disassembly.
Now I have absolutely no reason left to trust any of the posted code as actual. Congratulations on being a timewaster.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]