Re: Advice saught on math functions

From: Sandy Harris (pashley@storm.ca)
Date: Sun Jul 14 2002 - 09:17:10 EST


Erik Andersen wrote:
>
> On Fri Jul 12, 2002 at 11:42:19AM -0400, Sandy Harris wrote:
> > Does dietlibc help?
> >
>
> This is kernel space. Using any math functions is forbidden
> in kernel space,

Exactly what do you mean by "forbidden"?

Granted the kernel does not normally contain math libraries,
and that linking in a 500 meg library would be spectacularly
silly, what's wrong with using a few carefully chosen math
functions in a driver?

The kernel does not, I think, normally use floating point.
Would things break if a library that does was linked in?
Is that what you mean?

> so using dietlibc, uClibc, or anything else
> is not going to work.

Just linking in a whole library won't work, but stealing code
from a size-optimized library might.

> Moving the math stuff to userspace will
> help, at which point he can use any C library that suits him,

The guy asking the question thinks he needs math in his driver
because he needs a system that talks to blind users during the
boot process, before any userspace programs can run.

I've already suggested writing a scaled integer math library.
This should be faster than float, accurate enough for speech.
If what Erik is objecting to is floating point in the kernel,
not just any sort of math, then it avoids his objection.

Another possible solution:

Use two machines, both set to put boot messages on a serial
console and connected so that when either reboots, the other
is used as console. Do your sound in userspace (which I agree
is where it belongs). Now as long as you don't reboot both
at once (use a UPS!), you have sound for boot messages.
-
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:27 EST