开发者

how can I change a variable I added to the kernel from an LKM?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜