From eb3dd5a39356be1bfbb366a8589072d84cc94856 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 12 Jun 2024 12:30:17 +0200 Subject: [PATCH] Demo module --- demo_module.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 demo_module.c diff --git a/demo_module.c b/demo_module.c new file mode 100644 index 0000000..1e03ee0 --- /dev/null +++ b/demo_module.c @@ -0,0 +1,26 @@ +#include +#include + +/* Meta Info */ +MODULE_DESCRIPTION("Demo kernel module."); +MODULE_VERSION("0.0.1"); +MODULE_AUTHOR("Imbus"); +MODULE_LICENSE("GPL"); + +/** + * @brief Called on load + */ +static int __init demo_mod_init(void) { + printk("Demo module loaded successfully..."); + return 0; +} + +/** + * @brief Called on unload + */ +static void __exit demo_mod_exit(void) { + printk("Demo module unloaded successfully..."); +} + +module_init(demo_mod_init); +module_exit(demo_mod_exit);