While many of the C tutorials may be considered (more or less) platform indendent, kernel and driver programming is, by nature, highly platform dependent.
This means that the examples in this tutorial are specific to one single platform (FreeBSD or Linux).
It is very important to specify the OS version and possible patches.
This is especially true for Linux, where the kernel API may vary a lot between version 2.4 and 2.6, but even between different 2.6.x versions.
Historically, the kernel API for FreeBSD has varied less between 4.x, 5.x, 6.x, and 7.x, but the examples always indicates with OS version was used for a particular example.
If not indicated otherwise, the FreeBSD examples have been tested with the FreeBSD 7.2 GENERIC kernel, and the Linux examples have been tested with linux-rt 2.6.28-3 (Ubuntu Studio).
Prerequisites for compiling kernel modules on FreeBSD:
bsd.kmod.mk (the Makefile for compiling kernel modules):