aboutsummaryrefslogtreecommitdiffstats
path: root/tasks/01/hello-world.c
blob: 5741402f309277c588aade342fc4a0bb43ee0098 (plain) (blame)
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
/*
 * hello-world.c - 'Hello World' in Antelope pictures on the first cave computer
 * chisled by the first caveman programmers
 *
 * v2   - use the preferred module_init and module_exit macros
 * v2.1 - add licensing and module documentation
 */
#include <linux/kernel.h> /* for pr_debug() */
#include <linux/module.h> /* for all kernel modules */

static int __init hello_world_init(void)
{
	pr_debug("Hello World.\n");
	return 0; /* means init_module loaded successfully */
}

static void __exit hello_world_exit(void)
{
	pr_debug("oh, the rest is silence.\n");
}

module_init(hello_world_init);
module_exit(hello_world_exit);

MODULE_LICENSE("MIT");
MODULE_AUTHOR("Bryan Brattlof <hello@bryanbrattlof.com>");
MODULE_DESCRIPTION("A Hello World Driver");
MODULE_SUPPORTED_DEVICE("testdevice");