|
我刚刚学模块驱动这方面的编程,问点白痴问题哈.希望大家不吝赐教.谢谢!
刚刚看了一个关于hello world的模块编程.
代码是这样的.
#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);
我将文件保存为hello.c然后make hello.出现的错误几大页.请问这种代码怎么来编译呢?谢谢! |
|