Driver porting: hello world
Posted Aug 13, 2007 16:31 UTC (Mon) by zlynx
In reply to: Driver porting: hello world
Parent article: Driver porting: hello world
The kernel does not have the Standard C libraries. It's a free-standing program, like some embedded code. The only libraries you are allowed to use are the ones declared in the Linux source include directories.
Math libraries are generally for floating point. The Linux kernel does not support floating point inside the kernel. Floating point adds a rather large and slow set of registers to save and restore. Not doing the save/restore means context switch in and out of the kernel is much faster.
You *can* do floating point in kernel if you *really* want to, but you'd better know exactly what you're doing. If your calculations are not precison critical, it'd be faster to use fractional integer math and small lookup tables to estimate things like sqrt and trig functions.
to post comments)