Среда:
ОС: Ubuntu 24LTS
ядро : 6.8.0-47-generic
Компилятор GCC C++17
ldd.cpp
Код: Выделить всё
#include
#include
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Debanjan Tewary");
MODULE_DESCRIPTION("A simple Hello, World Module");
static int hello_init(void)
{
printk(KERN_INFO "Hello, world!\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_INFO "Goodbye, world!\n");
}
module_init(hello_init);
module_exit(hello_exit);
Код: Выделить всё
obj-m += ldd.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
Код: Выделить всё
make -C /lib/modules/6.8.0-47-generic/build M= modules
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-47-generic'
make[3]: *** No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by 'arch/x86/include/generated/uapi/asm/unistd_32.h'. Stop.
make[2]: *** [arch/x86/Makefile:249: archheaders] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-47-generic'
make: *** [Makefile:4: all] Error 2
Подробнее здесь: https://stackoverflow.com/questions/791 ... -x86-entry