К сожалению, я не вижу драйвера в журналах и скомпилированный файл не создается< /p>
Код драйвера
Код: Выделить всё
/***************************************************************************//**
* \file driver.c
*
* \details Simple hello world driver
*
* \author EmbeTronicX
*
* *******************************************************************************/
#include
#include
#include
/*
** Module Init function
*/
static int __init hello_world_init(void)
{
printk(KERN_INFO "This is the Simple Module\n");
printk(KERN_INFO "Kernel Module Inserted Successfully...\n");
return 0;
}
/*
** Module Exit function
*/
static void __exit hello_world_exit(void)
{
printk(KERN_INFO "Kernel Module Removed Successfully...\n");
}
module_init(hello_world_init);
module_exit(hello_world_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("A simple hello world driver");
MODULE_VERSION("2:1.0");
Код: Выделить всё
user@user-VirtualBox:~/linux/drivers/misc$ ls | grep answer
answer.c
Код: Выделить всё
user@user-VirtualBox:~/linux/drivers/misc$ vim Makefile
Код: Выделить всё
odj-$(CONFIG_ANSWER) += answer.o
Код: Выделить всё
user@user-VirtualBox:~/linux/drivers/misc$ vim Kconfig
Код: Выделить всё
config ANSWER
tristate "Add the answer"
help
my module
Код: Выделить всё
user@user-VirtualBox:~/linux$ vim .config
Код: Выделить всё
# Misc devices
#
CONFIG_ANSWER=y
Код: Выделить всё
user@user-VirtualBox:~/linux$ sudo make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs
Кроме того, драйвер не скомпилирован. Я добавил драйвер в меню; показано в .config.
Я максимально упростил драйвер. Если бы в нем были ошибки, они бы отобразились в выводе?
Я также пробовал менять разрешения.
Код: Выделить всё
-rw-rw-r-- 1 user user 955 Jul 31 17:52 answer.c
Подробнее здесь: https://stackoverflow.com/questions/788 ... er-does-no