|
如题,看过书上写的例子hello.C,照着做了一下,kernel是2.6.33.3,虚拟机linux kernel也是2.6.33.3,步骤如下:
1.make oldconfig 用了5小时完成了
2.照抄hello.C的例子
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);
3.makefile 内容:
obj-m := hello.o
3.make -C /home/model_test/linux-2.6.33.3 SUBDIRS= $PWD
modules
make: Entering directory `/home/model_test/linux-2.6.33.3'
make: Nothing to be done for `/home/model_test'.
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK include/linux/version.h
make[2]: “scripts/unifdef”是最新的。
Building modules, stage 2.
MODPOST 2117 modules
make: Leaving directory `/home/model_test/linux-2.6.33.3'
生成以上信息,但没有产生模块文件,路过的指点一下!!!!!!!! |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|