登录站点

用户名

密码

hello内核模块编译的全过程

已有 363 次阅读  2010-06-30 17:09   标签hello  模块  内核  编译 

内核版本:2.6.10

在/home/tmp/下建立两个文件hello.c,Makefile

hello.c
------------
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>

MODULE_LICENSE("GPL");

static int hello_init(void)
{
printk(KERN_ALERT "hello module init\n");
return 0;
}

static void hello_exit(void)
{
printk(KERN_ALERT "hello module exit\n");
}

module_init(hello_init);
module_exit(hello_exit);

--------------

......

点击查看原文:http://www.hzlitai.com.cn/article/ARM9-article/system/1773.html

 

上一篇: 如何编写Linux设备驱动程序 下一篇: 比较外围接口 选择最优开发环境的s3c6410开发板

分享 举报