I am starting learning with a very basic "hello world" LKM, plus I have added functionality to the kernel and successfully recompiled and it works. What I like to do now is add a variable to the compiled kernel code, then from my LKM be able to change that variable when I load and unload module. This way I can s开发者_运维技巧tart and stop the kernel functionality without recompile. any suggestion?
thank you
Two solutions :
1) expose the variable to userspace via proc/sysfs (preferred way)
2) use a character device driver to send an ioctl.
精彩评论