|
|
我把redhat9.0升级到2.6.10版本,升级成功了,除了一些usb keyboard,mouse驱动等,(我不使用)。但是我在里面编写了一个最基本的模块程序:就是linux drivers 3rd里面的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,"BYE-BYE\n");
}
module_init(hello_init);
module_exit(hello_exit);
当用gcc -c hello.c 编译的时候出现:如图:(在虚拟机下调时)
请问是什么原因? |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|