Now that we know much more about how system and devices are working togeder lets talk about kernel modules
# list modules loaded into kernel
# /proc/modules
lsmod | head
cat /proc/modules | grep -i vbox
lsmod | grep -i vboxpci
# Remove a module
modprobe -r vboxpci
rmmod vboxpci
# Load a module
modprobe modulenName
insmod full-Path-to-module
# get module info
modinfo vboxpci
# load vboxpci with insmod and full path
insmod /lib/modules/4.4.0-53-generic/updates/dkms/vboxpci.ko
# show dependencies of a module
modprobe --show-depends vboxpci
So if I load vboxpci then vboxdrv also will be loaded
The process at remove is the same.
whatis lsusb
whatis lspci
lsusb
lsusb -t # dump hierarchy as a tree
# check bus 003
lsusb -s 003:
# bus 003 device 006
lsusb -s 003:006
# USB with vendor id: 1000 and device id: 1320
lsusb -d 1000:1320
There is a list of all knowen usb vendor and products:
lsusb | sort | cut -d ' ' -f1-2 | uniq
# vendor code
lspci -n | head -2
# name and code of vendor
lspci -nn | head -2
# lspci -vvv (verbose to three times)
# lspci -d [<vendor>]:[<device>][:<class>]
lspci -d 8086:0416:0300
lspci -s :02.0
# domain, bus, slot, func
lspci -s 00:04:00.0
# bus, slot, func
lspci -s 04:00.0
# slot
lspci -s 00 | head -2
# which kernel is in charge of handeling the device
lspci -k | grep -i vga -A3
use another file instead of pci.ids:
lspci -i [file]
# lspci -vmm # machine readable
# lspci -x # hexadecimal
ipynb
format: https://github.com/ravexina/linux-notes. html
exports of project available at: https://ravexina.github.io/linux-notes.Linux Notes by Milad As (Ravexina) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.