|
发表于 2018-2-27 10:02:12
只看该作者
地板
大神好,同样的代码在ubuntu14.04上编译出错。
hello.c
- #include <linux/init.h>
- #include <linux/module.h>
- #include <linux/kernel.h>
- static int __init hello_init(void)
- {
- printk(KERN_ALERT "hello driver init \n");
- return 0;
- }
- static void __exit hello_exit(void)
- {
- printk(KERN_ALERT "hello driver exit \n");
- }
- module_init(hello_init);
- module_exit(hello_exit);
复制代码
Makefile
- PWD=$(shell pwd)
- obj-m := hello.o
- KDIR :=/home/bingo/firefly-rk3288-kernel
- default:
- make ARCH=arm CROSS_COMPILE=/home/bingo/Downloads/arm-eabi-4.6/bin/arm-eabi- -C $(KDIR) M=$(PWD) modules
- clean:
- rm -rf *.o *.ko *.mod.c .*.cmd *.markers *.order *.symvers .tmp_versions
复制代码 报错
- make ARCH=arm CROSS_COMPILE=/home/bingo/Downloads/arm-eabi-4.6/bin/arm-eabi- -C /home/bingo/firefly-rk3288-kernel M=/home/bingo/Desktop/hello modules
- make[1]: Entering directory `/home/bingo/firefly-rk3288-kernel'
- WARNING: Symbol version dump /home/bingo/firefly-rk3288-kernel/Module.symvers
- is missing; modules will have no dependencies and modversions.
- CC [M] /home/bingo/Desktop/hello/hello.o
- In file included from include/linux/mmzone.h:18:0,
- from include/linux/gfp.h:4,
- from include/linux/kmod.h:22,
- from include/linux/module.h:13,
- from /home/bingo/Desktop/hello/hello.c:2:
- include/linux/page-flags-layout.h:5:30: fatal error: generated/bounds.h: No such file or directory
- compilation terminated.
- make[2]: *** [/home/bingo/Desktop/hello/hello.o] Error 1
- make[1]: *** [_module_/home/bingo/Desktop/hello] Error 2
- make[1]: Leaving directory `/home/bingo/firefly-rk3288-kernel'
- make: *** [default] Error 2
复制代码
求指点~
|
|