The Free Software Magazine has published an introductory article on FreeBSD kernel modules (getting started). http://www.freesoftwaremagazine.com/articles/writing_a_kernel_module_for_freebsd