From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 17 21:07:05 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C4471065675 for ; Wed, 17 Mar 2010 21:07:05 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-fx0-f224.google.com (mail-fx0-f224.google.com [209.85.220.224]) by mx1.freebsd.org (Postfix) with ESMTP id CCB6A8FC18 for ; Wed, 17 Mar 2010 21:07:04 +0000 (UTC) Received: by fxm24 with SMTP id 24so994315fxm.3 for ; Wed, 17 Mar 2010 14:07:03 -0700 (PDT) Received: by 10.102.211.9 with SMTP id j9mr819791mug.130.1268860023488; Wed, 17 Mar 2010 14:07:03 -0700 (PDT) Received: from localhost (18-167-133-95.pool.ukrtel.net [95.133.167.18]) by mx.google.com with ESMTPS id y6sm35105548mug.50.2010.03.17.14.07.01 (version=SSLv3 cipher=RC4-MD5); Wed, 17 Mar 2010 14:07:02 -0700 (PDT) Date: Wed, 17 Mar 2010 23:05:41 +0200 From: Alex RAY To: Oleksandr Tymoshenko Message-Id: <20100317230541.df7060f3.ray@ddteam.net> In-Reply-To: References: Organization: DDTeam.net X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: GPIO button and userspace X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2010 21:07:05 -0000 On Wed, 17 Mar 2010 12:14:49 -0700 Oleksandr Tymoshenko wrote: > > On 2010-03-17, at 12:04 PM, Alex RAY wrote: > > > Hackers > > help find the correct answer, in what way I can send interrupt on GPIO to > > the userspace script. > > I know that I can make the device, and open it in program, but it is > > cumbersome. > > I know what I can run the script from the kernel, as in Linux, but I think > > this is not the right way? > > IMHO the best way to implement it is to run scripts through devd. e.g. create > use subsystem "GPIO" and few event types: "BUTTON_DOWN", "BUTTON_UP", > /add yours here/. From the kernel side it's just a matter of calling devctl_notify if I got it right. > > -- > gonzo > > > Sorry, I forgot to clarify that no devd here and no free space for it :) Embedded, Flash 4M for all. -- Alex RAY