sin()/cos()/tan() for kernel code? '_ 'a
psionic at gmail.com
Mon Feb 12 16:30:49 UTC 2007
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.
On 2/12/07, Alexander Leidinger <Alexander at leidinger.net> wrote:
> Quoting Stephen Montgomery-Smith <stephen at math.missouri.edu> (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
> 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 at freebsd.org mailing list
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
More information about the freebsd-hackers