
Linux Kernel Development and Writing a Simple Kernel Module (2018) - whack
https://devarea.com/linux-kernel-development-and-writing-a-simple-kernel-module/#.Xmpn5C2B3mE
======
kuharich
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. You're looking at kmalloc() as the kernel equivalent
for malloc(), 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. The best way is to use the source, look at
other examples and search the code. But there is an API, and most common
things have not really changed for decades now

------
b5n
I reccomend [https://kernelnewbies.org/](https://kernelnewbies.org/) as a
first stop for the curious (although I might also reccomend Emacs, contrary to
their tutorial ;).

------
ctas
I wish there would be more guides like this for macOS KEXT development. Easy
to read, clean code examples, and quick to get started.

I was planning to port a driver for a specific PCI 802.11 NGFF WiFi device
from FreeBSD or Linux, but it's really hard to find exhaustive guides on KEXT
development, whereas Linux has the amazing guide at
[https://www.kernel.org/doc/html/latest/driver-
api/80211/inde...](https://www.kernel.org/doc/html/latest/driver-
api/80211/index.html).

~~~
yjftsjthsd-h
I thought Apple was deprecating (3rd party) kernel-mode drivers? Or am I
misremembering that?

~~~
saagarjha
Correct: [https://developer.apple.com/support/kernel-
extensions/](https://developer.apple.com/support/kernel-extensions/)

