From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 23 06:16:21 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 8317B16A4CE for ; Thu, 23 Sep 2004 06:16:21 +0000 (GMT) Received: from priv-edtnes56.telusplanet.net (outbound01.telus.net [199.185.220.220]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11AF243D48 for ; Thu, 23 Sep 2004 06:16:21 +0000 (GMT) (envelope-from cpressey@catseye.mine.nu) Received: from catseye.biscuit.boo ([154.20.76.195]) by priv-edtnes56.telusplanet.netSMTP <20040923061620.SQKY7617.priv-edtnes56.telusplanet.net@catseye.biscuit.boo>; Thu, 23 Sep 2004 00:16:20 -0600 Date: Wed, 22 Sep 2004 23:17:24 -0700 From: Chris Pressey To: freebsd-hackers@freebsd.org Message-Id: <20040922231724.1d95c1c0.cpressey@catseye.mine.nu> In-Reply-To: <20040922224649.GG47410@afields.ca> References: <20040922224649.GG47410@afields.ca> Organization: Cat's Eye Technologies X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-portbld-freebsd4.9) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: kylincsos@hotmail.com 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 06:16:21 -0000 On Wed, 22 Sep 2004 18:46:49 -0400 Allan Fields wrote: > 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