Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/errno.h>
- //#include <linux/init.h>
- // パラメータ変数宣言
- int num=0;
- char *msg="def msg";
- // 引数にとる変数型と変数を宣言
- module_param(num, int, S_IRUGO);
- module_param(msg, charp, S_IRUGO);
- // 初期化関数
- static int __init hello_init2(void) {
- printk("hello!! \n");
- printk("num=%d, msg:%s\n", num, msg);
- return 0;
- }
- // 終了関数
- static void __exit hello_exit2(void)
- {
- printk("Goodby!!\n");
- }
- // ライセンス情報を宣言(GPLとする)
- MODULE_LICENSE("GPL");
- // 初期化関数宣言
- module_init(hello_init2);
- // 終了関数宣言
- module_exit(hello_exit2);
Add Comment
Please, Sign In to add comment