Page 1 of 1

PCI Devices - Is This Right?

Posted: Tue Jun 19, 2007 8:24 am
by Lprogster
...

Posted: Tue Jun 19, 2007 12:30 pm
by Combuster
Does that correctly identify the vendor, device and version of a PCI device?
Two notes:

Code: Select all

 version = pci_read_short ( bus , slot , 0 , 8 ) >> 8; 
this reads in the Class code and subclass, then discards the former. You probably want to read a short 0xA which is the Revision ID.

Also, your code does not support multifunction devices, Several motherboard resources are commonly collected on one 'slot' with different functions. A cheap way to detect those is by checking wether there are different device/vendor IDs in different functions.
Oh, an something I've been wondering: does VESA support hardware cursors? I haven't found anything on it so far...
AFAIK, that's hardware-dependent business. As a matter of fact I'm trying to get that to work on my ATI card but its accellerator CRTC declared war on me :(

Posted: Tue Jun 19, 2007 4:11 pm
by exkor
I would go with this link as example http://www.osdev.org/osfaq2/index.php/W ... n%20PCI%3F

Posted: Wed Jun 20, 2007 1:57 am
by Lprogster
AFAIK, that's hardware-dependent business. As a matter of fact I'm trying to get that to work on my ATI card but its accellerator CRTC declared war on me...
Okay, good luck with that - though I'm sure you'll manage!
this reads in the Class code and subclass, then discards the former. You probably want to read a short 0xA which is the Revision ID.
...

Thank you both,
Lster

Posted: Wed Jun 20, 2007 3:01 am
by Combuster
Wouldn't the class code and subclass be at 0xA and the revision ID 0x8? As the right-side of the table is 0 and the left 31...
Ack ](*,)% X_X _&&](*,)!"#O.o$#$&](*,) My wrong.

Posted: Wed Jun 20, 2007 5:18 am
by Lprogster
Wow! God made a mistake! :) ;)

Posted: Wed Jun 20, 2007 2:06 pm
by Combuster
If I was God, it was obviously part of the big plan 8)