0

In my understanding linux can list only those devices which it can understand, i.e. for which the drivers have been installed. I think lspci is the command for that.

But how can one figure out if there exists some device in the system for which the drivers are not installed and perhaps some hint about what that device is for and what driver would suffice for it.

I would like to know this info so as to be able to recompile my linux kernel to a minimum and would like to avoid a hit and trial approach.

3
  • 1
    No. lspci shows all devices. Regardless of drivers.
    – Hennes
    Oct 4, 2012 at 17:15
  • @Hennes So how is it able to output the device name string, if it can't talk to the device in the absence of driver? Oct 4, 2012 at 17:27
  • Your computer does not need a specific driver just to 'ask' a device for its ID. There is a standarised way for the OS to do this query. Once it knows which device it is it can select a driver to talk to it. No such driver means no working hardware, but it is still able to list which hardware you got.
    – Hennes
    Oct 4, 2012 at 17:36

4 Answers 4

3

lspci will do the trick as said by several others.

Some additional clarification:

Every modern bus-interface (Vesa Local Bus, PCMCIA, CardBus, PCI, PCI-X, PCI-e, Thurderbolt, IDE, ATAPI, SATA, USB, Firewire, just to name a few that come to mind) defines a set of low-level probe commands so the OS can detect which devices (if any) are present on that bus.

Such commands return a device-id to the OS. The OS then compares this id with the id's that the drivers "advertises" as id's that they feel capable of handling.
This is a necessity as otherwise the OS would have no way to determine what is present in the machine. If the OS can't tell what is there, it has no way of matching a device with the required driver.

(The above is true for any modern OS. Linux, Windows and OSX do exactly the same thing.)

Back to Linux:
The drivers for the OS to do this are part of the core-drivers for the various interface-buses that need to be present in the kernel (or as a loadable module).
Of course: Any bus-interface/device-drivers required to boot and load the root file-system need to be in the kernel at boot-time. Anything else can be a module if you want to keep the size of the kernel down, or omitted altogether if such hardware isn't in the system at all.
Typical first-time mistake is to make ALL file-sytem drivers modules. You will need at least 1 of them to be able to load the root-filesystem.

3

lspci -v will show the connected devices, even if there's no corresponding driver.

2
  • So how is it able to output the device name string, if it can't talk to the device in the absence of driver? Oct 4, 2012 at 17:17
  • 1
    It gets a long number from the device. Part of that it manufacturer ID (e.g. all intel PCI devices start with 8086 as their ID), part of it is the type of card. This last number can be looked up in a table. This table is just a list of numbers, nothing more.
    – Hennes
    Oct 4, 2012 at 17:30
2

I also like the lshw on those distributions to offer it.

Lots of good information about your CPUs, memory slots, USB slots, disks, and more.

1

If you want extended information of all hardware, you can use dmidecode command. It dumps the DMI table contents.

Not the answer you're looking for? Browse other questions tagged .