디바이스 드라이버에서 쉘 프로그램 실행이 가능 한가요?

teaeune의 이미지

어떻게 해야 될까요? 함수가 존재 하나요?

prether의 이미지

실제로 제가 직접 해본 적은 없지만
kernel에서 call_usermodehelper()을 부르면 user-space application을 실행할 수 있습니다. 2.4에서는 exec_usermodehelper()라고 불렸죠. 그런데 이 함수는 process-context에서만 불릴 수 있습니다. 즉 softirq상태에서는 안됩니다.

제 생각엔 이 문제를 타개하기 위해 device driver module을 Load할 때 process-context에서 도는 보조적인 kernel thread를 하나 돌리고 이 kernel thread가 어떤 조건을 wait하거나 polling하도록 만듭니다. 그래서 원하는 조건이 되면 call_usermodehelper()을 부른거죠.

물론 제 생각일 뿐입니다. 실제로 해본 적은 없습니다. :(

/***************************************
Being the one is just like being in love.
***************************************/

/***************************************
Being the one is just like being in love.
***************************************/