From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 12 16:30:49 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 294FF16A407 for ; Mon, 12 Feb 2007 16:30:49 +0000 (UTC) (envelope-from psionic@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.228]) by mx1.freebsd.org (Postfix) with ESMTP id C8D0313C474 for ; Mon, 12 Feb 2007 16:30:46 +0000 (UTC) (envelope-from psionic@gmail.com) Received: by nz-out-0506.google.com with SMTP id i11so1742819nzh for ; Mon, 12 Feb 2007 08:30:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Ux56Gwg709CQqwR+W+TVNk7VExcPBJddgvz6ouscvwCHDf6OAdYFDaMonyCIjFTvcZqcRbPLrEQSKK/H2OYDr0hn+vXLugMzG6U7wDz3LcH0CPZW4ruj2A0PhMVLq0Kc8Dal8AdS0ibiazULzZxLR1HFfu1d9vmsNHHs/pv3tyk= Received: by 10.114.155.1 with SMTP id c1mr5942004wae.1171296175008; Mon, 12 Feb 2007 08:02:55 -0800 (PST) Received: by 10.114.126.6 with HTTP; Mon, 12 Feb 2007 08:02:54 -0800 (PST) Message-ID: <5ad23a300702120802n19d4c32byed16dbad291135be@mail.gmail.com> Date: Mon, 12 Feb 2007 08:02:54 -0800 From: "Jordan Sissel" To: "Alexander Leidinger" In-Reply-To: <20070212101632.qa3p4f5wkkoccsk0@webmail.leidinger.net> MIME-Version: 1.0 References: <45CED641.7020608@ab.ote.we.lv> <20070211110815.O62469@math.missouri.edu> <20070211115815.O62469@math.missouri.edu> <20070212101632.qa3p4f5wkkoccsk0@webmail.leidinger.net> X-Mailman-Approved-At: Mon, 12 Feb 2007 17:08:14 +0000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Daniel Eischen , "Eugene M. Kim" , hackers@freebsd.org Subject: Re: sin()/cos()/tan() for kernel code? '_ 'a 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: Mon, 12 Feb 2007 16:30:49 -0000 As it stands right now, moused is not the proper place for this. sysmouse(4) only speaks relative coordinates and has no idea about absolute positioning that have the opportunity of doing with tablets and touchpads. I highly recommend this be implemented as an X driver, unless you have no intention of using your tablet in X. In X, you can specify your driver gives absolute positioning. There's also an existing wacom driver for X which may provide some/all of the functionality you need. IMO, there's no reasonable gain in doing complex mouse drivers in the kernel. For one, you'd have to have it speak a protocol X (assuming again that you're using X) understands. -Jordan On 2/12/07, Alexander Leidinger wrote: > > Quoting Stephen Montgomery-Smith (from > Sun, 11 Feb 2007 12:00:12 -0600 (CST)): > > > > > > > On Sun, 11 Feb 2007, Stephen Montgomery-Smith wrote: > > > >> > >> > >> On Sun, 11 Feb 2007, Daniel Eischen wrote: > > >>> Can't you do this in userland? Teach moused? > >> > >> Since you will only need sin and cos evaluated to the nearest > >> degree, if that, I suggest a simple look up table. There is also > >> something called the CORDIC method, I think, but I suspect that the > >> look up table will be so much easier to program, and negligable > >> extra space overhead. > >> > >> Stephen > > > > And if you do need more accuracy than the nearest degree, the formulae > > > > sin(x+h) = sin(x) + h cos(x); > > cos(x+h) = cos(x) - h sin(x) > > > > for small h (say |h| less than half a degree) should provide way more > > accuracy than you should need. > > There's work underway which moves the hard work of the mouse drivers > from the kernel to moused. The kernel just has a simple hardware > interface there, and the real interpretion of all the stuff from the > mouse happens in the userland. > > See http://www.semicomplete.com/projects/newpsm/ for more. > > So maybe it would be better to implement this in moused right from the > beginning... > > Bye, > Alexander. > > -- > Love is never asking why? > > http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 > http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > >