Re: Advice saught on math functions

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Fri Jul 12 2002 - 09:46:12 EST


On Fri, 12 Jul 2002, Kirk Reiser wrote:

> Hi Folks: What I am striving to do is build a software based speech
> synthesizer into a linux driver. It is a greatly hacked version of
> rsynth I call tuxtalk. My problem is that I have the code so far cut
> down to about 66k without the shared library routines. When I
> staticly build the object comes out to over 512k. Obviously this is
> to large to want built-in to the kernel. The majority of the size is
> from libm.a. There are five functions I need from the library, log(),
> log10(), exp() cos() and sin().
>
> My questions are:
> Are these functions which are supplied by the FPU? I've looked
> through the fpu emulation headers and exp() is the only one I can find
> any reference to.
>
> Is there a better method to provide these functions than to pull them
> out of libm.a?
>
> I appreciate any suggestions or recommendations people may have on
> these questions.
>

I think you want to do this in user-mode so you get to use
the FPU on Intel Machines. Actual interface to any hardware,
i.e., the stuff that sends/receives sounds can be done in
a cooperating kernel module.

We do this kind of stuff here at Analogic. We make all kinds
of waveforms using mathematics, then we write the stuff to
hardware memory and end up with really complex waveforms with
periods in the GHz range, while we created them at a leisurely
MHz or less (build waveform, then upload changes).

You really don't want to use 'C' runtime library routines inside
the kernel because some expect to interface to the kernel using
the user-mode API (int 0x80). This is NotGood(tm)!

Cheers,
Dick Johnson

Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).

                 Windows-2000/Professional isn't.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:22 EST