Execute shell command in kernel module

前端 未结 3 881
半阙折子戏
半阙折子戏 2021-02-10 03:18

Is it possible to execute shell command in kernel module. I know that we can do it in user space C code using system subroutine.
I am debugging a kernel module

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-10 04:01

    Its not possible to run a shell command from inside the kernel. You can instead read the /proc/meminfo file by calling the suitable procfs API to read the /proc/meminfo file. That virtual file has useful memory stats about the system memory.

提交回复
热议问题