Reading PCI IDs ?

This is a discussion on Reading PCI IDs ? within the Linux Programming forums, part of the Platform Specific Boards category; Hi, how can one read the PCI ID of the chipset built into a computer? I know lspci can do ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    15

    Reading PCI IDs ?

    Hi,

    how can one read the PCI ID of the chipset built into a computer?
    I know lspci can do it with "-n" and the first line contains the PCI ID of the chipset:
    Code:
    $ lspci -n
    00:00.0 0600: 8086:2a00 (rev 03)
    [...]
    The bold marked info is what I'm looking for. I haven't dealt with such things in C before and the lspci source code wasn't especially useful for me because I just wasn't able to understand it... (I'm not a professional coder, it's just a hobby and I'm not doing this for so long)

    So if anyone can tell me where exactly in the lspci source code I will have to look or has a simpler piece of code it would be great if he'd share it with me

    Peter

  2. #2
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,274
    Try looking at:

    /proc/pci
    /proc/bus/pci/devices
    /proc/bus/pci/*

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    lspci reads the files under /sys/bus/pci/devices (you can easily find this out without browsing it's source using the command #strace lspci 2>&1 | less)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 03-05-2009, 03:14 AM
  2. Replies: 7
    Last Post: 02-02-2009, 07:27 AM
  3. Replies: 2
    Last Post: 01-28-2008, 03:07 AM
  4. reading float from file
    By arjunajay in forum C++ Programming
    Replies: 10
    Last Post: 07-31-2005, 12:01 AM
  5. PCI modem needs help
    By Jaguar in forum Tech Board
    Replies: 3
    Last Post: 09-26-2003, 02:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21