Continue reading “Linux: Find out what kernel drivers (modules) are loaded”
Q. How do I display information about loaded kernel modules under Sun Solaris UNIX operating system?
A. You need to use modinfo command which is a trivial program to display information about the loaded modules. The format of the information is as follows:
Id Loadaddr Size Info Rev Module Name
where Id is the module ID, Loadaddr is the starting text address in hexadecimal, Size is the size of text, data, and bss in hexadecimal bytes, Info is module specific information, Rev is the revision of the loadable modules system, and Module Name is the filename and description of the module.
Task: Displaying the status of kernel modules
Just enter modinfo command:
You can pass -c option to modinfo command to display the number of instances of the module loaded and the module’s current state:
Display information about particular module / driver only
You can also display information about particular module only by specifying its ID #:
modinfo -i 5
The above example displays the status of module # 5.
Read modinfo man page for other information and options.
Under Linux, you use term called modules for device drivers. The driver can be loaded or unloaded as per your requirement using commands. Each driver or module gives the Linux information on how to control that particular Ethernet card. The name of each module (driver) is listed in the /etc/modules.conf file.
Command to find out Ethernet card driver name
You can try any one of the following command to find out your Ethernet card driver:
# dmesg | grep 'Ethernet driver'
8139cp: 10/100 PCI Ethernet driver v1.2 (Mar 22, 2004)
Or search a file called /var/log/dmesg:
# grep 'Ethernet driver' /var/log/dmesg
8139too Fast Ethernet driver 0.9.27 8139cp: 10/100 PCI Ethernet driver v1.2 (Mar 22, 2004)
You can also get driver name from config file:
# grep eth0 /etc/modules.conf
alias eth0 8139too
# vi /etc/modules.conf
Search for eth0 string.
In above example 8139too is driver loaded for eth0. You can find out more information about this driver using modinfo command:
# modinfo 8139too
modinfo program to show information about a Linux Kernel module. You can also find out all loaded modules or drivers using lsmod command:
# lsmod | less
lsmod is a program to show the status of modules in the Linux Kernel.