A Template For Writing Linux Kernel Drivers

Posted by Michael Larabel on November 13, 2012

LDT has been published, a Linux Driver Template for helping new Linux kernel developers begin writing hardware device drivers.

Constantine Shulyupin posted the Linux Driver Template (LDT) for merging into the mainline Linux kernel and it can be used as a starting point for new drivers. The basic driver demonstrates file operations including mmap and ioctl and blocking modes and polling, KFIFO, completion, interrupts, Tasklets, work, kthreads, timer, simple misc devices, multiple char devices, Device Model, configfs, UART, hardware loopback, software loopback, and ftracer. There's also an accompanying user-mode test script and utility.

Those wanting to look at this simple Linux device driver sample code can find it currently on the Linux mailing list. There's also other Linux kernel samples on eLinux.org for device drivers.

Discuss this article in our forums, IRC channel, or email the author. You can also follow our content via RSS and on social networks like Facebook, Identi.ca, and Twitter (@Phoronix and @MichaelLarabel). Subscribe to Phoronix Premium to view our content without advertisements, view entire articles on a single page, and experience other benefits.
Latest Hardware Reviews
  1. Sumo Lounge Emperor
  2. Gallium3D Continues Improving OpenGL For Older Radeon GPUs
  3. 15-Way Open vs. Closed Source NVIDIA/AMD Linux GPU Comparison
  4. Nouveau vs. NVIDIA Linux Comparison Shows Shortcomings
Latest Software Articles
  1. Intel Linux OpenGL Driver Leading Over Apple OS X
  2. The Cost Of Ubuntu Disk Encryption
  3. Btrfs vs. EXT4 vs. XFS vs. F2FS On Linux 3.10
  4. AMD Radeon R600 GPU LLVM 3.3 Back-End Testing
Latest Linux News
  1. SQLite Now Faster With Memory Mapped I/O
  2. Microsoft Releases Skype For Linux 4.2, Has Bug-Fixes
  3. Qt For Tizen Launches, Based On Qt 5.1
  4. KTAP Released For Linux Kernel Dynamic Tracing
  5. Linux 3.10-rc2 Kernel Takes In A Few Extra Pulls
  6. QEMU 1.5 Supports VGA Passthrough, Better USB 3.0
  7. Handbrake 0.9.9 Supports OpenCL Offloading
  8. Freedreno Gallium3D Now Banging The Adreno A3XX
  9. Jolla Announces Their First Phone
  10. Mageia 3 Released, Still Using Legacy GRUB
  11. NetBSD 6.1 Brings In More Features
Latest Forum Talk
  1. Qt For Tizen Launches, Based On Qt 5.1
  2. Microsoft Releases Skype For Linux 4.2, Has...
  3. AMD Radeon R600 GPU LLVM 3.3 Back-End Testing
  4. Modern Intel Gallium3D Driver Still Being Toyed...
  5. Linux's "Ondemand" Governor Is No...
  6. Intel Linux OpenGL Driver Leading Over Apple OS X
  1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Motherboards
  5. Peripherals
  6. Processors
  7. Software
  8. Operating Systems
  9. All Articles
  1. Linux Benchmarking
  2. OpenBenchmarking.org
  3. Phoronix Test Suite