官术网_书友最值得收藏!

How it works...

The insmod command just takes our module and inserts it into the kernel; after that, it executes the module_init() function.

During module insertion, if we're over an SSH connection, we'll see nothing on the Terminal and we have to use dmesg to see kernel messages (or tail on the /var/log/kern.log file, as discussed previously); otherwise, on the serial console, after inserting the module, we should see something like the following:

dummy_code: loading out-of-tree module taints kernel.
dummy_code:dummy_code_init: dummy-code loaded
Note that the message, loading out-of-tree module taints kernel, is just a warning and can be safely ignored for our purposes. See https://www.kernel.org/doc/html/v4.15/admin-guide/tainted-kernels.html for further information about tainted kernels.

The rmmod command does the inverse steps of insmod, that is, it executes the module_exit() function and then removes the module from the kernel.

主站蜘蛛池模板: 子长县| 磐安县| 临颍县| 武鸣县| 六枝特区| 化州市| 博客| 新乡县| 清徐县| 瑞金市| 大埔区| 吉林省| 乌兰浩特市| 古浪县| 屏东市| 昌江| 三都| 台东县| 波密县| 乌兰浩特市| 西乌珠穆沁旗| 蒙阴县| 株洲市| 兴安县| 博罗县| 绥阳县| 石阡县| 石狮市| 阿拉善右旗| 靖州| 东方市| 普兰店市| 元朗区| 禹州市| 永康市| 丹棱县| 宝山区| 门头沟区| 绿春县| 黄浦区| 江北区|