-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhellokernel3.c
More file actions
29 lines (22 loc) · 747 Bytes
/
hellokernel3.c
File metadata and controls
29 lines (22 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#define DRIVER_AUTHOR "Gabriel <GThiago>"
#define DRIVER_DESC "A sample driver"
static int __init init_hello_4(void){
printk(KERN_INFO "Hello, World 3!\n");
return 0;
}
static void __exit cleanup_hello_4(void){
printk(KERN_INFO "Goodbye, World 3\n");
}
module_init(init_hello_4);
module_exit(cleanup_hello_4);
MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
/* This module uses /dev/testdevice, The MODULE_SUPPORTED_DEVICE macro night
* be used in the future to help automatic configuration of modules, but is
* currently unused other than for documentation purpose
*/
MODULE_SUPPORTED_DEVICE("testdevice");