AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Writing kernel modules linux c11/7/2023 ![]() Note that you cannot use X, such as an xterm, as the kernel only prints directory to consoles or log files. Use modinfo modulename, for file modulename.ko, to determine module information. Loaded modules are listed in /proc/modules. Modprobe, insmod and depmod are found in the module-init-tools or kmod packages. While insmod requires detailed instructions about the path and file names of requested modules, modprobe does not. If there are dependencies, insmod loads these before it loads the requested module. The p file is created using the depmod -a command, which determines if a particular module calls functions or variables (symbols) that are defined by other modules. In order to determine module dependencies, modprobe searches /lib/module/version/p and determines if other modules must be loaded before the requested module can be. Modprode search /proc/nf to relate an module alias to an actual module. Modprobe is passed a string argument that may be an actual module name or an alias to module. A kernel module daemon kmod, often executes modprobe in order to load a module. In order to add a module to the kernel you can use the modprobe command. This example has been shortened for obvious reasons. ![]() Please note that the output printed by lsmod is usually very long and contains several kernel modules listed. An example output of lsmod is the following: To determine loaded modules run the command lsmod, which reads the file /proc/modules. ![]()
0 Comments
Read More
Leave a Reply. |