Я определил следующие файлы
файл main.c
Код: Выделить всё
#include "main.h"
static int __int entrypoint(void)
{
pr_info("Helloworld");
new_function(void);
return 0;
}
static void __exit exitpoint(void)
{
pr_info("Goodbye World");
}
module_init(entrypoint);
module_exit(exitpoint);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("SSV");
MODULE_DESCRIPTION("SIMPLE DRIVER");
MODULE_INFO(X86, "X86-64bit");
Код: Выделить всё
#include "main.h"
void new_function(void)
{
pr_info("hello new function \n");
}
MODULE_LICENSE("GPL");
Код: Выделить всё
#include
void new_function(void);
Код: Выделить всё
obj-m := main.o
main-objs :=function.o
all:
make -C /lib/modules/$(shell uname -r)/build/ M=$(shell pwd) modules
clean:
make -C /lib/modules/$(shell uname -r)/build/ M=$(shell pwd) clean
[ 2991.240255] main: loading out-of-tree module taints kernel.
[ 2991.240263] main: module verification failed: signature and/or required key missing - tainting kernel
I was expecting module to be loaded and print statements to be printed from both the files
Источник: https://stackoverflow.com/questions/781 ... urce-files
Мобильная версия