- Linux Device Driver Development Cookbook
- Rodolfo Giometti
- 135字
- 2021-06-24 13:54:15
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.
推薦閱讀
- Linux設備驅動開發詳解:基于最新的Linux4.0內核
- Linux系統架構與運維實戰
- 曝光:Linux企業運維實戰
- Installing and Configuring Windows 10:70-698 Exam Guide
- 計算機系統開發與優化實戰
- 混沌工程:復雜系統韌性實現之道
- RESS Essentials
- 巧學活用Windows 7
- Learning Magento 2 Administration
- Mastering Reactive JavaScript
- 應急指揮信息系統設計
- OpenStack Essentials(Second Edition)
- Mastering Sass
- Java EE 8 High Performance
- 辦公自動化教程(Windows7+Office2010)