What is platform driver?

What's the best way to learn device driver development on Linux?

  • What's the best way to learn device driver development on Linux? Or for that matter on any platform? I am an experienced networking guy with decent proficiency in C. Wondering what the best course of action would be to develop a device driver, for say an 11n wireless chipset. Linux seems the obvious choice for development. I was looking at the Linux certified driver development course, but I'm not sure how much it would really help; it appears to be more of a noob course. Any suggestions from driver developers on what's the best way to go about learning? Are there any good books / do it yourself hardware/software kits?

  • Answer:

    I second you that Linux is the best choice to learn device driver development since you have plenty of examples (the Linux core represents only a small percentage of the total source code, most are device drivers), lots of devices supported by Linux, documentation and a well established global community. To learn device driver development, like any other new knowledge, the best approach for me is to learn first the theory and then to do some practice. If you don't know about operating systems, I recommend "Willam Stalling's OS book" [1]. This book has a more hardware oriented approach unlike other OS books that focused more on the algorithms and data structures used in operating systems. After having a high level overview of operating systems, you have to learn about Linux kernel development. Robert Love's book [2] is for me the best one on the subject. You can learn not only about Linux kernel development, but also the motivations behind the technical decisions that lead to the design. Then you have to learn about device drivers development on Linux, two books that are very good are "Linux Device Drivers" [3] and "Essential Linux Device Drivers" [4]. This two books are complementary. The former teaches how to write virtual device drivers for memory based devices, so you can try the examples without the need of special hardware. While the latter shows you how device drives for real devices are actually written. I maintain an up-to-date repository with all LDD3 examples so you can compile and test on recent kernels [5]. Once you have the theory you can begin with the practice by writing real device drivers. You need a hardware that still is not supported on Linux. The good news is that you probably already have one of these devices. With the popularity of the Android platform, is very likely that you own an Android device. Even when Android is a Linux-based operating system, Google by a design decision forked the Linux kernel and added some APIs [6] that don't exist on the Linux kernel. These APIs are used by device drivers and for that reason, a developer has to choose whether to write a device driver for Android or Linux. So, porting Android device drivers to Linux is an excellent opportunity to learn device driver development skills, the Linux kernel development process and how to work with the Linux community while doing something useful. [1]: http://williamstallings.com/OS/ [2]: http://blog.rlove.org/2010/07/linux-kernel-development-third-edition.html [3]: http://lwn.net/Kernel/LDD3/ [4]: http://elinuxdd.com/ [5]: https://github.com/martinezjavier/ldd3 [6]: http://lwn.net/Articles/416690/

Javier Martinez Canillas at Quora Visit the source

Was this solution helpful to you?

Other answers

In order to develop Linux device drivers, it is necessary to have an understanding of the following: C programming. Some in-depth knowledge of C programming is needed, like pointer usage, bit manipulating functions, etc. Microprocessor programming. It is necessary to know how microcomputers work internally: memory addressing, interrupts, etc. All of these concepts should be familiar to an assembler programmer. You are asking about Character device driver, start with the following link., Character Device Driver Have to know major & minor number, kernel space & user space,registering & unregistering a device, opening & closing a device , reading & writing a device , IOCTL (Input Output Control) operations on a device.Once you start writing simple device drivers then go ahead with the following link Linux Device Drivers, Third Edition Linux Device Drivers (Hard copy) Written Nov 20 •

Sivakumar R.J

To write device driver component of Linux Kernel, in your case it is wireless chipset driver, developer must have fair understanding of followings:1. What is the difference between userspace and kernel space 2. How to write kernel modules3. Using printk and basics kernel debugging3. How to interact with kernel from user space using ioctl. netlink sockets, proc filesystems, system call etc (Here you can skip netlink socket being novice user ) 4. How to copy data from userspace to kernel space and vice-versa5. Interrupt Handling 6. Bottom Half & Soft irq7. Linux Kernel Synchronization Techniques  8. Basic Understand of Hardware Architecture, which is PCI in most of cases  I would recommend you to refer https://lwn.net/Kernel/LDD3/ and start writing basics samples code.  We, Impeccable Research Labs, also offer instruct led Linux Kernel Programming Certification Course which have been designed, developed and delivered by IT experts, please check https://irlabs.io/courses/category/linux-systems

Anil Kumar

For learning  Linux driver development  good way is to first learn about basic architecture and internals of linux kernel and then understanding basic driver architecture and then you can start writing small drivers Below link has very good series of Linux device drivers tutorials http://www.tutorialsdaddy.com/2015/04/introduction-to-linux-kernel/

Shivam Mehta

If you are interested in learning how to write device drivers for Linux, consider http://eudyptula-challenge.org/. You will get a series of challenges that will eventually have you write a device driver. You cannot receive a new challenge unless you have finished the old one. And there is always feedback on your submissions especially when you make mistakes. I cannot say that this is the best way though since in my opinion it depends on one's own experience and outlook on things.

Aya Mahfouz

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.