From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 23 07:56:20 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C5FB516A4CE for ; Thu, 23 Sep 2004 07:56:20 +0000 (GMT) Received: from hotmail.com (bay1-f22.bay1.hotmail.com [65.54.245.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id B069C43D64 for ; Thu, 23 Sep 2004 07:56:20 +0000 (GMT) (envelope-from kylincsos@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 23 Sep 2004 00:55:01 -0700 Received: from 61.187.16.2 by by1fd.bay1.hotmail.msn.com with HTTP; Thu, 23 Sep 2004 07:54:00 GMT X-Originating-IP: [61.187.16.2] X-Originating-Email: [kylincsos@hotmail.com] X-Sender: kylincsos@hotmail.com From: "Gordon David" To: cpressey@catseye.mine.nu, freebsd-hackers@freebsd.org Date: Thu, 23 Sep 2004 07:54:00 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=gb2312; format=flowed Message-ID: X-OriginalArrivalTime: 23 Sep 2004 07:55:01.0060 (UTC) FILETIME=[A0C82040:01C4A142] Subject: Re: execute a user process in the kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2004 07:56:20 -0000 > > 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