Goal
Implement a kernel module that can passing parameter when insert module, and add an entry to /proc that can write/read data. In embedded linux often using similar facility to help debug.
Code:
Makefile:
Usage:
1. Insert module and make /proc/Ray entry#>sudo insmod test_module.ko entry="Ray" mode=1238
2. Write data#>echo 123 > /proc/Ray3. Read data#>cat /proc/Ray
沒有留言:
張貼留言