Date: Thu, 23 Sep 2004 07:54:00 +0000 From: "Gordon David" <kylincsos@hotmail.com> To: cpressey@catseye.mine.nu, freebsd-hackers@freebsd.org Subject: Re: execute a user process in the kernel Message-ID: <BAY1-F222XdoYfYoiB500002b85@hotmail.com>
next in thread | raw e-mail | index | archive | help
> > On Wed, Sep 22, 2004 at 08:49:11AM +0000, Gordon David wrote: > > > Hello, > > > > > > I have a question. Anyone would like to tell me how to execute a > > > user process or shell script in the kernel? > > > > You probably really don't want to do this and if you do, there is > > likely a better approach. > >Reading between the lines and guessing - here's what you can do: > >Write a userland program that (1) reads /dev/fooctl, (2) does something >based on what it got from /dev/fooctl, and (3) goes back to step (1). > >Then write a kernel driver that produces output on /dev/fooctl every >time it wants the userland program to do something. > >This achieves the effect you (probably) want while maintaining the >seperation between kernel and userland. >HTH, >-Chris That's the point. I do not want the userland program to check /dev/fooctl from time to time. I want the kernel to notify the userland program instead. So how shall I do it? Maybe linker_load_file is a better way. Thx. Gordon _________________________________________________________________ 享用世界上最大的电子邮件系统— MSN Hotmail。 http://www.hotmail.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BAY1-F222XdoYfYoiB500002b85>