commit | author | age
|
b8e5f6
|
1 |
/* |
G |
2 |
* Copyright (C) 2024 LingYun IoT System Studio |
|
3 |
* Author: Guo Wenxue <guowenxue@gmail.com> |
|
4 |
* |
|
5 |
* Hello driver example in linux kernel. |
|
6 |
*/ |
|
7 |
|
|
8 |
|
|
9 |
#include <linux/init.h> |
|
10 |
#include <linux/module.h> |
|
11 |
#include <linux/kernel.h> |
|
12 |
|
|
13 |
static __init int hello_init(void) |
|
14 |
{ |
|
15 |
printk(KERN_ALERT "Hello, Linux kernel module.\n"); |
|
16 |
return 0; |
|
17 |
} |
|
18 |
|
|
19 |
static __exit void hello_exit(void) |
|
20 |
{ |
|
21 |
printk(KERN_ALERT "Goodbye, Linux kernel module.\n"); |
|
22 |
} |
|
23 |
|
|
24 |
module_init(hello_init); |
|
25 |
module_exit(hello_exit); |
|
26 |
|
|
27 |
MODULE_LICENSE("Dual BSD/GPL"); |
|
28 |
MODULE_AUTHOR("GuoWenxue <guowenxue@gmail.com>"); |