|
|
Log in / Subscribe / Register

Driver porting: hello world

Driver porting: hello world

Posted Aug 13, 2007 16:31 UTC (Mon) by zlynx (guest, #2285)
In reply to: Driver porting: hello world by apc20
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


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds