I wrote a kernel module that creates a entry in /proc/ and does some other tasks.
I want to modify an existing kernel module to check if my module is running and execute some sentences depending on it (or execute others in case it is not running)
Any advice on how to do this?
kernel/module.cprovides a function that will probably do what you need; you first need to lockmodule_mutexand then callfind_module()with the name of your module. The result will be a pointer to astruct modulethat describes the named module — orNULLif the module is not loaded: