In Linux systems, a kernel module is a dynamically loaded extension that adds new features or drivers to the kernel. However, sometimes after exporting the kernel module, we may encounter problems that cannot be called. This article describes how to solve this problem and provides corresponding source code examples.
- Make sure the function is exported correctly
First, we need to make sure that the functions we wish to call are correctly exported in the kernel module. In the Linux kernel, EXPORT_SYMBOL
functions can be exported using macros. Here's an example:
#include <linux/module.h>
void my_function(void)
{
// 在这里实现函数的功能
}
EXPORT_SYMBOL(my_function