- 论坛徽章:
- 0
|
初学者求教 helloworld
我的虚拟机上装的redhat enterprise linux 4版本,我刚写了一个helloworld.c驱动,helloworld.c放在/home/student/driver目录下,
我不知道怎么编译这个驱动,有那位高手个我解决下,谢谢.
helloworld.c源码:
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk(KERN_ALERT "Hello World enter!\n");
return 0;
}
static int hello_exit(void)
{
printk(KERN_ALERT "Hello world exit!\n");
return 0;
}
module_init(hello_init); /* load the module */
module_exit(hello_exit); /* unload the module */ |
|