-
Notifications
You must be signed in to change notification settings - Fork 2
/
cam.c
41 lines (33 loc) · 888 Bytes
/
cam.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
/*
* This is a demo Linux kernel module.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
/*
* template_init - function to insert this module into kernel space
*
* This is the first of two exported functions to handle inserting this
* code into a running kernel
*
* Returns 0 if successfull, otherwise -1
*/
static int __init template_init(void)
{
printk("Hello World, here is your module speaking\n");
return 0;
}
/*
* template_cleanup - function to cleanup this module from kernel space
*
* This is the second of two exported functions to handle cleanup this
* code from a running kernel
*/
static void __exit template_cleanup(void)
{
printk("Short life for a small module...\n");
}
module_init(template_init);
module_exit(template_cleanup);
MODULE_DESCRIPTION("Small module, demo only, not very useful.");
MODULE_LICENSE("GPL");