LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   What functions can I use in Kernel mode (https://www.linuxquestions.org/questions/programming-9/what-functions-can-i-use-in-kernel-mode-425958/)

draksonije 03-18-2006 05:34 AM

What functions can I use in Kernel mode
 
Hi,
I know I cand use standard library funcions such as stdio.h in kernel mode. What I dont know is what are the alternatives? More precisely I need alternative for stdlib.h malloc function .
Thanx Dragan

jschiwal 03-18-2006 08:46 AM

Many of the same functions exist, using the same names, but with the letter "k" before them.
Look at the man page for __kmalloc

Novel Press published a book "Linux Kernel Development" by Robert Love. There are also books available on kernel internals, and kernel devices that might interest you.

Also, there is documentation included with the kernel itself /usr/src/linux/Documentation/. Although it may be packaged separately by your distro under the name kernel-docs.

paulsm4 03-18-2006 12:50 PM

jschiwal is right:

1. kmalloc is one alternative

2. Kernel 2.6 offers other alternatives, including the rich, powerful "slabs" API

3. Robert Love's "Linux Kernel Development, 2nd Ed" is an excellent book that discusses these -
and many other essential issues - in depth. It's an absolute must-have:
http://www.bookpool.com/sm/0672327201

4. Another, complementary book that's also a must-have is the O'Reilly "Linux Device Drivers, 3rd Ed":
http://www.bookpool.com/sm/0596005903

5. And of course - as jschiwal also said - the best reference is /usr/src/linux, starting with "Documentation/"!


All times are GMT -5. The time now is 05:22 AM.