-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathhelloworld.c
More file actions
42 lines (23 loc) · 782 Bytes
/
helloworld.c
File metadata and controls
42 lines (23 loc) · 782 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
30
31
32
33
34
35
36
37
38
39
40
41
#include <linux/module.h>
#include <linux/kernel.h> // Debug messages
#include <linux/init.h> //macros
#include <linux/moduleparam.h>
#include <linux/stat.h>
MODULE_LICENSE("GPL");
#define DRIVER_AUTHOR "SourceCodeDeleted"
#define DRIVER_DESC "Some hello world param driver"
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_SUPPORTED_DEVICE("testdevice");
static char *MyString = "";
module_param(MyString, charp, 0000);
MODULE_PARM_DESC(MyString, "This is a string that gets echoed.");
static int HelloInit(void){
printk(KERN_INFO "ROOTKITDEV_DEBUG: %s \n", MyString);
return 0;
}
static void HelloExit(void){
printk(KERN_INFO "ROOTKITDEV_DEBUG : GOODBYE WORLD \n");
}
module_init(HelloInit);
module_exit(HelloExit);