The untrue myths about Linux kernel programming

Posted on Nov 22, 2014

The Introduction

I gave a talk at LinuxCon Europe in Duesseldorf this year which main goal was to show to people how easy it is to start the Linux Kernel development. Despite of my fear that the audience might be too advanced and find this topic rather boring I received a good feedback with several opinions that this kind of guideline and advices are more than welcomed. Now, since the room capacity was about 30 people, which is not really much, I have the impression that there are more folks out there who would enjoy this topic. Therefore I decided to form the presentation into a series of articles.

These articles, similarly as the talk, will be divided into three parts. In first, not really technical related, I will explain that the unlike many may think the Linux Kernel development is super easy especially for those who possess the right attitude. In second part I’m going to show where to get inspiration from and what are the best angles to approach the Linux Kernel development thing for the newcomers. The third and last part will describe some of the things that I wish that I knew before I started.

The Myths

For some reason there is a group of negative opinions or myths describing either the Linux Kernel programming itself or the effort required to become the Linux Kernel developer. In particular these are:

  • The Linux Kernel programming is hard and requires special skills
  • The Linux Kernel programming requires access to a special hardware
  • The Linux Kernel programming is pointless because all of the drivers have already been written
  • The Linux Kernel programming is time consuming

Let’s put more details into this way of thinking:

The Linux Kernel programming is hard and requires special skills. This thinking comes from the fact that many people, especially without proper knowledge of the kernel internals tend too view the the whole project as one big blob of code, effectively an operating system itself. Now, we all know that writing the operating systems is damn hard job and requires deep understanding of quite a number of different topics. Usually this is not just a hobby ;) but something that you are well prepared for. Looking at the top-level Linux Kernel developers does not help either because all of them have many years of experience and judging own skills using them as a reference is misleading and leads to believe that the special skills are in fact required.

The Linux Kernel programming requires access to a special hardware. Jim Zemlin, who is the executive director of the Linux Foundation, said during his keynote that there are certain metrics which show that the Open Source software is running on the 80% of electronic devices. The Linux Kernel, as the biggest Open Source project ever, gets more than a huge bite of this cake. In fact this is the most portable software of this size ever created and it supports the insane number of different hardware configurations. With this in mind one might get the impression that working on the kernel is about running it on the different kind of devices and since the most popular are already supported a successful developer needs to have access to odd hardware.

The Linux Kernel programming is pointless because all of the drivers have already been written. The very popular impression of the Linux Kernel programming is writing drivers for various kind of peripheral devices. This is in fact the way that many nowadays professional kernel hackers have started their Linux carers. However with the portability that the kernel offers it may seem that it is hard to find the unsupported device. Naturally we could look at the USB devices land as here we have the majority of peripherals however the variety of those is either already supported or it is better to use the libusb and solve the problem from the user space thus no kernel work.

The Linux Kernel programming is time consuming. While reading the LKML or any other kernel related mailing list such as for example driverdevel list it is easy to notice that the number of patches send weekly is significant. For instance the work on the comedi drivers generates sets with many patches in it. It clearly shows that someone is working really hard out there and the comedi is not alone as an example. For people for whom the kernel development is going to be a hobby, not a daily job, this might be repealing as they could feel that they just cannot keep up the pace with that kind of speed of development.

The Myths explained

These either alone or accumulated can draw a solid, thick line between trying the Linux kernel development and letting it go. This is especially true for the less experienced individuals who therefore may fear to try however the truth is that the devil is not as black as painted. All of these myths can be taken down so let’s do it one by one:

The Linux Kernel programming is fairly easy. One can view the Kernel code as a single blob with rather high complexity however this blob is highly modularized. Yes, some of the modules are really a hardcore (like scheduler) however there are areas of less complexity and thee truth is that in order to be able to do very simple, maintenance tasks the required skill is a decent C knowledge.

Not everyone has to redesign kernel core modules, there is plenty of other work that needs to be done. For example, the very popular newbie task is to improve the code quality by fixing either the code style issues or comiler warnings.

It is not required to posess special hardware. Well, the old x86 is still good enough to do some parts of the work and since this architecture is still quite popular I would say that it is more than enough for most of the people. Those who seek more can buy one of the cheap ARM based boards such as PandaBoard, BeagleBone or RaspberryPi.

It is not pointless, there is still work to be done, a lot of work to be done. First thing to know is that the Linux kernel is not only about the drivers but there is also the core code which needs to be taken care of. Second there is still a vast amount of drivers to be completed and help in this area is more than appreciated.

It does not have to be time consuming as whoever works on the kernel allocates as much time as he or she wants. The people who do it by passion, aside of their daily duties, use a few evenings a week and they still contribute. I started contributing during the period where I run every second day (evening), I did the complete renovation of the part of my apartment, I went for holidays and I watch almost every game during the World Cup 2014 and World Volleyball Championship 2014 - there was not much time left for kernel stuff and still I succedded to send a few patches.

The important thing to remember is that unless you are paid for it there is no pressure and no hurry so take it easy and do as much as you can.

Conclusion

In this first installment of the “encouraging people to do the kernel programming” we did the complete change of the mindset by explaining that what might have seemed hard is in fact fairly easy to do. Just remember that:

  • The Linux Kernel programming is fairly easy
  • It is not required to have access to special hardware
  • There is still a lot of work to be done
  • You can allocate as much time as you want and as you can

Armed with this knowledge we are ready for the next part which will give an insight of what could be the starting point of Linux kernel development.