Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6333

kernel module - how to make that my module upload automatically at boot time?

$
0
0

I'm using a centos 8. I made a module where every time the module goes up it prints "Hello World" and every time the module goes down it prints "Goodbye".How do I make the module load automatically during boot?

#include <linux/module.h> #include <linux/kernel.h> int init_module(void){  printk("Hello world\n");  return 0;}void cleanup_module(void){  printk(KERN_INFO "Goodbye\n");   }module_init(init_module);module_exit(cleanup_module);

The name of this file is mymodule.c .

(I have seen other posts here about this but they do not explain where I place my module, and what I record in a configuration file). So I would love an explanation, thank you very much


Viewing all articles
Browse latest Browse all 6333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>