Use of the ubuntulinux driver module-general Linux technology-Linux programming and kernel information. The following is a detailed description. Linux is based on modules, and all drivers are modular:
Management Module command:
2,
Modinfo:
Modinfo can view the module information and determine the purpose of the module by viewing the module information;
Ty @ tonylinux :~ $ Modinfo bluetooth
Filename:/lib/modules/2.6.15-27-386/kernel/net/bluetooth. ko
Author: Maxim kranyansky , Marcel Holtmann
Description: Bluetooth Core ver 2.8
Version: 2.8
License: GPL
Alias: net-pf-31
Vermagic: 2.6.15-27-386 preempt 486 gcc-4.0
Depends:
Srcversion: 7EE5558C84FD3DB2B68971C
3,
Modprobe mounts new modules and modules dependent on the new modules
The common function of modprobe is to mount a module. When a kernel module is mounted, the modules on which this module depends are also mounted. This is different from the insmod Mount module. Of course, modprobe also provides a list of all kernel modules, as well as the function of removing modules. Next we will give an example to illustrate our common functions and parameters;
Modprobe-c
Odprobe-c can view the modules configuration file, such as the module alias;
Modprobe-l is used to list all modules in the kernel, including mounted and unmounted modules. Through modprobe-l, we can view the modules we need and mount them according to our needs;
[Root @ localhost beinan] # modprobe Module name Note: mount a module;
Root @ localhost beinan] # modprobe-r module name Note: Remove loaded modules, which have the same functions as rmmod;
4,
Rmmod remove mounted modules
Rmmod Module name
5. depmod: List of module dependencies created
This module management tool is used to create a list of module dependencies. Just pay attention to a few parameters. Currently, the Linux release uses the kernel version 2.6x to automatically resolve dependencies, this command is fine. The module also has dependencies before. For example, if we want to drive a USB mobile hard disk, there are currently two types of drivers: udev, which are available in the kernel, however, it is not stable at present. Another method is to use the usb-storage driver, while the usb-storage depends on the scsi module. Therefore, we need to use the usb-storage module, install scsi.
This command creates a dependency for the modules. dep file or ing file. The modules. dep file is located in/lib/modules/2.6.15-27-i386. This is the directory file of my computer.
6. insmod mounting Module
The insmod tool is a bit similar to modprobe, but it does not have a strong modprobe function. In the Mount module, modprobe does not need to specify the path of the module file or the suffix of the file. o or. ko; what insmod needs is the absolute path of the directory where the module is located, and must contain the module File name suffix (modulefile. o or modulesfile. ko );
[Root @ localhost beinan] # insmod/lib/modules/2.6.11-1.1369 _ FC4/kernel/drivers/net/tg3.ko
Module configuration file modules. conf or modprobe. conf
The automatic mounting module of the kernel module is usually located in a configuration file. The common Linux releases all have/etc/modules. conf or/etc/modprobe. conf. For example, the file automatically loaded by the Fedora Core 4.0 kernel module upon startup is/etc/modprobe. conf; in this file, it is generally written to the module's load command or module alias definition. For example, in modules. A similar line may be released in conf;
The driver for source code compilation is generally. /configure; make install, sometimes the program does not provide. /configure, we can make or make install, or execute make; make install; if you cannot make install, We need to copy it by ourselves. o or. go to the/lib/modules/kernel version/kernel/directory or the corresponding driver directory in the/lib/modules/kernel version/kernel/drivers directory;
I 'd like to try it myself. I can't say it clearly. I will know how to solve the problem. The driver's REAME and INSTALL will prevail.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service