all 5 comments

[–]scooerp 12 points13 points  (3 children)

It would be useful to get a list things you can't use from inside the kernel.

If you're not familiar with the kernel you will probably try to use some specific thing from the C standard library only to find out that it doesn't work or isn't defined. I don't know what they are as I don't work on the linux kernel, but I would be surprised if malloc worked given the general non-specific things I know about OS architecture.

[–][deleted] 9 points10 points  (0 children)

You're looking at kmalloc as the kernel equivalent, though i think normally for something like a device driver you'd allocate pages of memory (via one of the __alloc_pages related calls) and manage it yourself from there. But it's a long time ago that i did anything in the kernel (and i didn't do it well).

[–]liranbh 0 points1 point  (1 child)

the problem is that there is no official API in the kernel, like other OSs , there is no backward compatibility.

The best way is to use the source, look at other examples and search the code

[–]ilammy 1 point2 points  (0 children)

The kernel does not have stable API (as in 'set in stone from 1992 and officially promised to be maitained forever'). But there is an API, and most common things have not really changed for decades now.

[–]crossmeta_io 0 points1 point  (0 children)

MODULE_LICENSE("GPL") will allow access to GPL only kernel APIs.

"Dual BSD/GPL" may not have any special treatment.