Nhận lỗi khi biên dịch mô-đun hạt nhân đầu tiên của tôi trong Fedora linux.fedora linux --- biên dịch mô-đun linux đầu tiên
Source code: -
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
#include <linux/init.h> /* Needed for the macros */
static int __init hello_start(void)
{
printk(KERN_INFO "Loading hello module...\n");
printk(KERN_INFO "Hello world\n");
return 0;
}
static void __exit hello_end(void)
{
printk(KERN_INFO "Goodbye Mr.\n");
}
module_init(hello_start);
module_exit(hello_end);
Makefile: ----
obj-m = hello.o
KVERSION = $(shell uname -r)
all:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
lỗi tại làm cho thời gian: -
$ make
make -C /lib/modules/3.8.6-203.fc18.x86_64/build M=/home/dinesh/development/linux/kernel_modules/hello modules
make: *** /lib/modules/3.8.6-203.fc18.x86_64/build: No such file or directory. Stop.
make: *** [default] Error 2
Bây giờ nếu tôi thấy xây dựng là có hay không, tôi nhận được sau o/p. Xây dựng được thể hiện như một softlink: ---
$ ls -l /lib/modules/3.8.6-203.fc18.x86_64/
total 2632
lrwxrwxrwx. 1 root root 38 Apr 15 21:32 build -> /usr/src/kernels/3.8.6-203.fc18.x86_64
drwxr-xr-x.
I got same error even after installing, kernel-devel :--
makefile của tôi là chính xác nó có tab chính xác trước khi quy tắc. Vui lòng đề xuất cách giải quyết lỗi này?
Hiện có '/ usr/src/kernels/3.8.6-203.fc18.x86_64' không? –
Chỉ có hai thư mục này tồn tại ----> /usr/src/kernels/3.8.7-201.fc18.x86_64 --- & --- /usr/src/kernels/3.9.4-200.fc18.x86_64 ----> softlink một không tồn tại – Katoch
Bây giờ phải làm gì? – Katoch