[問題] kernel space呼叫user space的binary

看板LinuxDev作者 (體重突破所有均線)時間14年前 (2011/08/26 21:00), 編輯推噓1(106)
留言7則, 3人參與, 最新討論串1/2 (看更多)
各位大神好 小弟現在碰到一個問題無法解決 狀況如下: 我在kernel space想要呼叫user space的binary file,並且傳參數給它 現在麻煩的是這個參數是run time才會知道 目前survey到一個類似的做法,但是無法傳參數 1) DECLARE_WORK產生一個work struct 2) PREPARE_WORK把我要執行的kernel function丟到一個work queue裡 這個kernel function裡呼叫call_usermodehelper來執行user space 的binary file 3) 呼叫queue_work() 請問一下 有辦法從kernel space執行user space的binary,並傳參數嗎? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.195.12.202

08/26 21:16, , 1F
call_usermodehelper(char *path, char **argv,
08/26 21:16, 1F

08/26 21:16, , 2F
char **envp, enum umh_wait wait)
08/26 21:16, 2F

08/26 21:18, , 3F
可以傳參數不是嗎?
08/26 21:18, 3F

08/27 00:15, , 4F
do_execve()??
08/27 00:15, 4F

08/27 00:59, , 5F
to 1F,應該是我寫的不好,我是指prepare work時無法傳
08/27 00:59, 5F

08/27 01:00, , 6F
呼叫call_usermodehelper()本身沒問題,重點是kernel
08/27 01:00, 6F

08/27 01:00, , 7F
function的部份
08/27 01:00, 7F
文章代碼(AID): #1ELvZy00 (LinuxDev)
文章代碼(AID): #1ELvZy00 (LinuxDev)