diff options
| author | jerome <jerome@xlinfo.fr> | 2025-07-19 22:26:16 +0200 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2025-07-19 22:26:16 +0200 |
| commit | 2e422b03a5f321e490fc8592ef7abc7d1d48eaad (patch) | |
| tree | 4e10e37fd19b3a7e6f9296bdf8228fd2d3da5188 /hello.c | |
| download | kernmodule-master.tar.gz kernmodule-master.zip | |
Diffstat (limited to 'hello.c')
| -rw-r--r-- | hello.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +#include <linux/init.h> +#include <linux/module.h> +#include <linux/kernel.h> + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Sachith Muhandiram"); +MODULE_DESCRIPTION("Simple first Linux module"); +MODULE_VERSION("1.0.0"); + + +static int __init initHelloWorld(void){ + printk(KERN_INFO "Hello, this is my first kernel module \n"); + return 0; +} + +static void __exit exitHelloWorld(void){ + printk(KERN_INFO "Exit Hello world module\n"); +} + +module_init(initHelloWorld); +module_exit(exitHelloWorld); |
