簡體   English   中英

如何從用戶空間應用程序插入內核模塊?

[英]How to insert kernel module from userspace app?

我在尋找一件事:

如何從用戶空間程序插入內核模塊? 誰能給我提供與此情況有關的任何示例嗎?

謝謝

拉海爾

稍作搜索后,我發現有一個名為

#include <linux/module.h>
int init_module(const char *name, struct module *image);

如果需要更多詳細信息,可以查看此手冊頁。
http://www.kernel.org/doc/man-pages/online/pages/man2/init_module.2.html

謝謝Adel C Kod,我剛剛解決了這個問題,在這里我發布了一個簡單的示例代碼:

char cmnd[10];

if (strcmp(cmnd, "insert")==0) {
  system ("/sbin/insmod /home/xyzUBUNtu/Desktop/MyMod/kernel1.ko");
  printf("Your Module inserted");
  return 1;
}

謝謝

Raheel ..

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM