mymodule.c
#include <linux/init.h>
#include <linux/module.h>
static int __init hello_init(void)
{
printk(KERN_ALERT "Hello!\n");
return 0;
}
static void __exit hello_exit(void)
{
printk(KERN_ALERT "Goodbye\n");
}
module_init(hello_init);
module_exit(hello_exit);
/* Module information */
MODULE_AUTHOR("xx");
MODULE_DESCRIPTION("dongle driver.");
MODULE_LICENSE("GPL");
Makefile
ifneq ( $(KERNELRELEASE), )
obj-m := mymod.o
mymod-objs := mymodule.o
else
KERNELDIR ?= ./arm-linux-2.6.31
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules ARCH=mips CROSS_COMPILE=arm-linux-
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
rm -rf Module.* modules.*
.PHONY: default clean
endif
博客内容提及了mymodule.c,推测与代码文件相关,但信息有限,未明确其具体用途和相关技术细节。
722

被折叠的 条评论
为什么被折叠?



