Linux PC端驱动程序实例
新建程序文件hello.c
(1)hello.c的路径如下:
helloworld/hello.c
(2)hello.c的内容如下:
1 #include <linux/init.h> 2 #include <linux/module.h> 3 4 static int __init hello_init(void) 5 { 6 printk("%s\n", __FUNCTION__); 7 return 0; 8 } 9 10 static void __exit hello_exit(void) 11 { 12 printk("%s\n", __FUNCTION__); 13 } 14 15 module_init(hello_init); 16 module_exit(hello_exit);