Linux device drivers list

Linux: Find out what kernel drivers (modules) are loaded

lsmod command

You need to use lsmod command to show the status of modules in the Linux Kernel. Simply type the lsmod at a shell prompt to list all loaded modules:
$ lsmod
Sample outputs:

Get more information about the driver

To get more information about specific driver use modinfo command. The syntax is:
modinfo < driver-name >
To see information about a Linux Kernel module called e1000, enter:
$ modinfo e1000
Sample outputs:

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

See modinfo and lsmod man pages for more info.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

Howto: Display List of Modules or Device Drivers In the Linux Kernel

H ow do I display the list of loaded Linux Kernel modules or device drivers on Linux operating systems?

You need to use lsmod program which show the status of loaded modules in the Linux Kernel. Linux kernel use a term modules for all hardware device drivers.

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements lsmod
Est. reading time Less than a one minute

Please note hat lsmod is a trivial program which nicely formats the contents of the /proc/modules , showing what kernel modules are currently loaded.

This is an important task. With lsmod you can verify that device driver is loaded for particular hardware. Any hardware device will only work if device driver is loaded.

Task: List or display loaded modules

Open a terminal or login over the ssh session and type the following command
$ less /proc/modules
Sample outputs:

To see nicely formatted output, type:
$ lsmod
Sample outputs:

First column is Module name and second column is the size of the modules i..e the output format is module name, size, use count, list of referring modules.

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Finding more info about any module or driver

Type the following command:
# modinfo driver-Name-Here
# modinfo thermal_sys
# modinfo e1000e
Sample outputs:

Источник

Where to find a list of device drivers supported by linux?

I have read here that linux supports a large number of device drivers and by extension, it also supports a large number of devices connected via the USB port. Excerpt from that site:

Linux today supports more hardware devices than any other operating system in the history of the world. It does this using a development model significantly different from the familiar Windows device driver model.

Is there a list of all the different devices which are supported by linux ? and/or list of devices which are connected via USB and supported by linux`?

This is different from just finding out which device drivers are currently supported in a given distribution by using the commands lsmod , lspci and dmesg | grep as the distribution providers only support few common drivers out of all the drivers supported by linux .

3 Answers 3

The lspci and lsusb commands just enumerates the devices connected to particular buses. They read id from the bus and use special file to map this ids to strings.

The lsmod showns just list of linux kernel modules. Linux kernel module is part of linux kernel code which is loaded dynamically — this modules are not necessary drivers, it may be just any part of the kernel code. This mechanism is used to save memory and boot time and do not load all code on boot, to make kernel development easier (you can unload/modify/load parts of the kernel). As the device driver is one of good applications of this dynamic loading — it is used in most drivers. The non-driver example is iptables (the network filtering mechanism) there only parts are loaded which are actually requested by user.

The dmesg is just a kernel text log — usually developer white something there in case of initialization, but this is entirely voluntary — so what you find there and which format is completely random.

Complete lists of the supported hardware is hard thing to get. Kernel consists of very different parts made by different people and there is a lot of similar devices with different labels.

Usually you can try to find if your device is supported on dedicated pages:

  • supported printers are on the linux printer database http://www.openprinting.org/printers
  • scanners are are sane page
  • video card on http://www.x.org/wiki/Projects/Drivers/
  • and so on

This is mainly because most things require not just kernel driver by also kind of userspace layer and there is kind of ‘project’ which does both parts with main interface in userspace.

Most advanced list of the supported may be extracted from kernel code — there is usually list of pci/usb ids supported for each particular drivers — there is a way to extract it: http://www.cyberciti.biz/tips/linux-find-supported-pci-hardware-drivers.html. But if you have kernel module which has an ID in the list doesn’t mean that device is fully supported or that you have userspace tools which allow you to use this module, or that this userspace tools exist in your particular distribution.

Sometimes distribution vendors provide list of supported devices, but this is usually some small subset.

For debian there is also list of pciid->kernel module mappings: https://wiki.debian.org/DeviceDatabase/PCI.

Regarding usb devices, many things like cameras have kind of userspace drivers via libusb — like cameras or so no. In such case you have no need in kernel driver at all.

Also, don’t forget that linux runs on near 20 architectures (imagine how many drivers are in billions of different android smart-phones), each with own huge set of drivers — and you’ll see that total amount will easily beat every other knows OS.

Источник

Linux: How to find the device driver used for a device?

If my target has one device connected and many drivers for that device loaded, how can I understand what device is using which driver?

8 Answers 8

Example. I want to find the driver for my Ethernet card:

First I need to find coordinates of the device using lspci ; then I find driver that is used for the devices with these coordinates.

sudo lspci -v will show it. like this:

You can also combine it with grep like this:

For USB based devices you can see the driver name by using the lsusb command:

And/or you use lshw which enumerates the devices on all buses including USB, PCI, etc so you can see which driver it uses:

If you just want to plainly use sysfs and doesn’t want to deal with all these commands which eventually looks inside sysfs anyways, here’s how:

say, what is the module/driver for eth6? «sfc» it is

or better yet.. let readlink resolve the path for you.

so. to figure out what are the drivers for all of your network interfaces:

You can use the lsmod command to get the status of loaded modules / devices drivers in the Linux Kernel.

For a specific device, you can use dmesg |grep to get the details too.

Источник

How to find the driver (module) associated with a device on Linux?

  • a device, for example /dev/sda ,
  • and its major and minor numbers, for example 8, 0 ,

how can I know which module / driver is «driving» it?

Can I dig into /sys or /proc to discover that?

4 Answers 4

To get this information from sysfs for a device file, first determine the major/minor number by looking at the output of ls -l , eg

The 8, 0 tells us that major number is 8 and the minor is 0 . The b at the start of the listing also tells us that it is a block device. Other devices may have a c for character device at the start.

If you then look under /sys/dev , you will see there are two directories. One called block and one called char . The no-brainer here is that these are for block and character devices respectively. Each device is then accessible by its major/minor number is this directory. If there is a driver available for the device, it can be found by reading the target of the driver link in this or the device sub-directory. Eg, for my /dev/sda I can simply do:

This shows that the sd driver is used for the device. If you are unsure if the device is a block or character device, in the shell you could simply replace this part with a * . This works just as well:

Block devices can also be accessed directly through their name via either /sys/block or /sys/class/block . Eg:

Note that the existence of various directories in /sys may change depending on the kernel configuration. Also not all devices have a device subfolder. For example, this is the case for partition device files like /dev/sda1 . Here you have to access the device for the whole disk (unfortunately there are no sys links for this).

A final thing which can be useful to do is to list the drivers for all devices for which they are available. For this you can use globs to select all the directories in which the driver links are present. Eg:

Finally, to diverge from the question a bit, I will add another /sys glob trick to get a much broader perspective on which drivers are being used by which devices (though not necessarily those with a device file):

Update

Looking more closely at the output of udevadm , it appears to work by finding the canonical /sys directory (as you would get if you dereferenced the major/minor directories above), then working its way up the directory tree, printing out any information that it finds. This way you get information about parent devices and any drivers they use as well.

To experiment with this I wrote the script below to walk up the directory tree and display information at each relevant level. udev seems to look for readable files at each level, with their names and contents being incorporated in ATTRS . Instead of doing this I display the contents of the uevent files at each level (seemingly the presence of this defines a distinct level rather than just a subdirectory). I also show the basename of any subsystem links I find and this showing how the device fits in this hierarchy. udevadm does not display the same information, so this is a nice complementary tool. The parent device information (eg PCI information) is also useful if you want to match the output of other tools like lshw to higher level devices.

Источник

Читайте также:  Amd radeon 6520g driver windows 10
Оцените статью