How is the Linux kernel module transferred to the kernel?

Source: Internet
Author: User
Article Title: How is the Linux kernel module transferred to the kernel ?. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Lsmod reads the/proc/modules file to check which kernel modules have been loaded by the kernel. If the extended functions required by the operating system kernel do not exist, the kernel module management daemon kmod executes modprobe to load the kernel module. When a common identifier is passed to modprobe, modprobe first searches for the string in the file/etc/modules. conf. Then, modprobe traverses the file/lib/modules/version/modules. dep to determine whether other kernel modules need to be loaded before the module is loaded. This file is created by command depmod-a and stores the dependency between kernel modules. Finally, modprobe calls insmod to first load the dependent module and then load the module required by the kernel. Modprobe directs insmod to the/lib/modules/version/[1] Directory, which is the default standard directory for storing kernel modules. Therefore, when you want to load a kernel module, you can execute:

Insmod/lib/modules/2.5.1/kernel/fs/fat. o

Insmod/lib/modules/2.5.1/kernel/fs/msdos. o

Or just execute "modprobe-a msdos ".

In Linux, modprobe, insmod and depmod are provided in a toolkit named modutils or mod-utils.

Modules compiled for a specific version cannot be loaded by another version of the kernel if the CONFIG_MODVERSIONS option is enabled in the kernel. Currently, most releases enable this option.

If you are modifying the kernel and want to avoid overwriting the module you are working on, you should try using the variable EXTRAVERSION in the kernel Makefile to create a unique module directory.

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.