-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhello-world.c
40 lines (32 loc) · 937 Bytes
/
hello-world.c
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
/*
* hello_world demonstration.
*
* Copyright (C) 2019 Matthias Brugger
*
* The source code in this file can be freely used, adapted,
* and redistributed in source or binary form, so long as an
* acknowledgment appears in derived source files. The citation
* should list that the code comes from the book "Linux Device
* Drivers" by Alessandro Rubini and Jonathan Corbet, published
* by O'Reilly & Associates. No warranty is attached;
* we cannot take responsibility for errors or fitness for use.
*/
#include <linux/module.h>
//#include <linux/moduleparam.h>
//#include <linux/init.h>
#include <linux/kernel.h> /* printk() */
MODULE_AUTHOR("Matthias Brugger");
MODULE_LICENSE("GPL2");
/*
* Module housekeeping.
*/
static int hello_world_init(void)
{
printk(KERN_WARNING "hello_world\n");
return 0;
}
static void hello_world_cleanup(void)
{
}
module_init(hello_world_init);
module_exit(hello_world_cleanup);