Device Driver Development

Getting Started

 * 1) Get a Linux system where you have root access
 * 2) Run, don't walk to get the Linux Device Drivers, 3rd ed or get it in PDF form, one file per chapter or the whole book as a tarred and compressed PDF
 * 3) Get this book's sample code and try and build some modules

OS Tools

 * 1) Find your kernel directory
 * 2) For my Fedora 8, this is in something like /usr/src/kernels/2.6.26.5-28.fc8-i686
 * 3) Go to the Documentation/kbuild directory, read and understand how kernel and device driver builds work
 * 4) See the file Documentation/Changes in the kernel dir to get a list of required tool versions

Online Resources

 * http://kernelnewbies.org/Drivers: stuff for newbies
 * http://www.kernel.org/: kernel archives

Building Sample Modules
Building kernel modules is different from source code in user-space. Assuming your kernel source is in /usr/src/kernel, a build command looks like

Environment Variables
If you are not running the kernel that you are building for, you can set the KERNELDIR variable to point to that kernel.