In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
In this article, the editor introduces in detail "what the kernel module in linux refers to", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "what the kernel module in linux refers to" can help you solve your doubts.
In linux, the kernel module is a socket provided by the linux kernel to the outside; the program of the kernel module has independent functions, which can be compiled separately, but can not be run independently, and is a code block that provides functions for the kernel or other kernel modules.
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
What is the kernel module in linux
Kernel module is a socket provided by Linux kernel, its full name is dynamically loadable kernel module (Loadable Kernel Module,LKM), we call it module for short. The Linux kernel provides a modular mechanism because it is itself a single kernel (monolithic kernel). The biggest advantage of a single kernel is high efficiency, because all the content is integrated together, but its disadvantage is that scalability and maintainability are relatively poor, and the module mechanism is to make up for this defect.
A module is a program with independent functions, which can be compiled separately, but cannot be run independently. It is linked to the kernel at run time and runs in kernel space as part of the kernel, which is different from processes running in user space. A module usually consists of a set of functions and data structures to implement a file system, a driver, or other functions at the top of the kernel.
In short, a module is a block of code that provides usage functionality for the kernel (in a sense, the kernel is also a module) or other kernel modules.
The kernel module of the Linux system is a code block that can be loaded into or unloaded from the kernel as needed, so the function of the kernel can be extended without rebooting. But unless users use commands like lsmod to query module information, they are unlikely to know about any changes to the kernel.
There are many modules available on the Linux system, and if you dig into them, you can learn a lot of details. One of the main uses of Linux system tool lsmod is to check the module when the system does not work properly.
1. Display kernel module
The easiest way to display kernel modules is to use the lsmod command. Although this command contains a lot of details, the output is very user-friendly, usually in the output:
1) Module displays the name of each module
2) Size shows the size of each module, not the amount of memory they occupy
3) Used by shows the number of times each module is used and the modules that use them
The number of modules loaded depends on the system and version used and what is running. To check the number of modules available in the system, not only those that are running, you can use this operation command:
1) $modprobe-c | wc-l
2) 41272
2. Other commands related to kernel modules
The Linux system provides several commands for listing, loading and unloading, testing, and checking the status of modules.
1) depmod-generate modules.dep and mapping files
2) insmod-- A program that inserts modules into the Linux kernel
3) lsmod-displays the status of modules in the Linux kernel
4) modinfo-displays Linux kernel module information
5) modprobe-add or remove Linux kernel modules
6) rmmod-A program that removes modules from the Linux kernel
3. Display the built-in kernel module
As the editor said earlier, the lsmod command is the most convenient command to display kernel modules. However, there are other ways to display them. All modules built in the kernel are listed in the modules.builtin file and are used when the modprobe command attempts to add modules in the file.
Users can use modinfo to get more details about a module, although there is no simple description of the services provided by the module, you can also use the modprobe command to load or unload the module. Using the following command, you can find the kernel object associated with a particular module:
1) $find / lib/modules/$ (uname-r)-name floppy*2) / lib/modules/5.0.0-13-generic/kernel/drivers/block/floppy.ko
If you want to load the module, you can use this command: $sudo modprobe floppy.
Obviously, the loading and unloading of kernel modules is very important. It makes Linux systems more flexible and efficient than when running with a general-purpose kernel. This also means that users can make major changes without rebooting, such as adding hardware.
After reading this, the article "what does the kernel module in linux refer to" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it to understand it. If you want to know more about related articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.