您的位置:首页 > 运维架构 > Linux

Linux内核编程:从hello world 开始-(1)_C文件编写

2014-12-07 22:11 381 查看
/*
*File    : test.c
*Author  : DavidLin
*Date    : 2014-12-07pm
*Email   : linpeng1577@163.com or linpeng1577@gmail.com
*world   : the city of SZ, in China
*Ver     : 000.000.001
*history :     editor      time            do
*          1)LinPeng       2014-12-07      created this file!
*          2)
*/

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

static int hello_init(void)
{
printk("Hello World Insmod\n");
}

static void hello_exit(void)
{
printk("Hello World Rmmod\n");
}

module_init(hello_init);
module_exit(hello_exit);

MODULE_AUTHOR("Linpeng1577");
MODULE_DESCRLPTION("Kernel: Hello World");
MODULE_LICENSE("GPL");

/* End of test.c */
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: