Device Driver Development
Jump to navigation
Jump to search
Getting Started
- Get a Linux system where you have root access
- 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
- Get this book's sample code and try and build some modules
OS Tools
- Find your kernel directory
- For my Fedora 8, this is in something like /usr/src/kernels/2.6.26.5-28.fc8-i686
- Go to the Documentation/kbuild directory, read and understand how kernel and device driver builds work
- 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
<source lang="bash"> make -C /usr/src/kernel M=`pwd` modules </source>
Building Your Device Driver
The Makefile
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.
See also
- http://tldp.org/LDP/lkmpg/2.6/html/
- http://www.xml.com/ldd/chapter/book/ch06.html#t1 (jiffies)
- http://kernelnewbies.org/Drivers
- http://ezs.kr.hsnr.de/TreiberBuch/html/ (complete book in german)