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

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.

主站蜘蛛池模板: 卫辉市| 新巴尔虎左旗| 民县| 韩城市| 青川县| 双鸭山市| 大竹县| 大安市| 鄱阳县| 兴义市| 湄潭县| 永昌县| 高陵县| 怀柔区| 木兰县| 黄浦区| 五河县| 赫章县| 永兴县| 封开县| 娄底市| 平乐县| 宜宾县| 城市| 怀安县| 德阳市| 炉霍县| 苍梧县| 城市| 东丰县| 松阳县| 乡城县| 连南| 锦屏县| 慈溪市| 泰来县| 杭州市| 略阳县| 夏津县| 彭阳县| 旬阳县|