32 lines
786 B
C
32 lines
786 B
C
// skeleton.c
|
|
#include <linux/module.h> // needed by all modules
|
|
#include <linux/init.h> // needed for macros
|
|
#include <linux/kernel.h> // needed for debugging
|
|
|
|
#include <linux/moduleparam.h> // needed for module parameters
|
|
|
|
static char* text = "dummy text";
|
|
module_param(text, charp, 0664);
|
|
static int elements = 1;
|
|
module_param(elements, int, 0);
|
|
|
|
static int __init skeleton_init(void)
|
|
{
|
|
pr_info ("Linux module 01 skeleton loaded\n");
|
|
pr_debug (" text: %s\n elements: %d\n", text, elements);
|
|
return 0;
|
|
}
|
|
|
|
static void __exit skeleton_exit(void)
|
|
{
|
|
pr_info ("Linux module skeleton unloaded\n");
|
|
}
|
|
|
|
module_init (skeleton_init);
|
|
module_exit (skeleton_exit);
|
|
|
|
MODULE_AUTHOR ("Daniel Gachet <daniel.gachet@hefr.ch>");
|
|
MODULE_DESCRIPTION ("Module skeleton");
|
|
MODULE_LICENSE ("GPL");
|
|
|