设为首页 加入收藏

TOP

Linux3.0.4下编译helloworld内核驱动程序
2014-11-24 12:57:57 来源: 作者: 【 】 浏览:0
Tags:Linux3.0.4 编译 helloworld 内核 驱动程序

#include


#include
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);


编译该helloworld的makefile文件是:


obj-m := helloworld.o
KERNELDIR := /lib/modules/3.0.4/build
PWD := $(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
clean:
rm -rf *.o *~core .depend .*.cmd *.ko *.mod.c .tmp_versions $(TARGET)


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C++实现日期类函数 下一篇Android中线程和Handle

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Python中文网 - 人生 (2025-12-24 18:49:47)
·【整整648集】这绝对 (2025-12-24 18:49:44)
·Python超详细一条龙 (2025-12-24 18:49:42)
·【超详细】JDK 下载 (2025-12-24 18:19:32)
·Java_百度百科 (2025-12-24 18:19:29)