+ -
当前位置:首页 → 问答吧 → 关于2.6内核驱动问题?

关于2.6内核驱动问题?

时间:2007-08-21

来源:互联网

各位大虾:
      我现在安装的的是linux的内核版本是2.4.20-8,我想在这个基础上编译一个运行在arm开发板上(内核版本2.6.14)hello的驱动。
我不知道该怎么写这个makefile?谢谢!      

作者: sherry_wang   发布时间: 2007-08-21

//下面是测试代码
#ifndef __KERNEL__
# define __KERNEL__
#endif
#ifndef MODULE
# define MODULE
#endif

#include <linux/config.h>
#include <linux/module.h>

MODULE_LICENSE("GPL");
#ifdef CONFIG_SMP
#define __SMP__
#endif

#include <linux/kernel.h>
int
init_module
(){
printk("Hello,World!\n");
return 0; /}

void
cleanup_module
(){
printk("---------hello!\n");
}      

作者: sherry_wang   发布时间: 2007-08-21