How to Learn Linux Kernel Development – Books and FREE Online Course


Programming, coding, development are some of the demanding jobs in the world right now.

Out of all those, a Linux Kernel Development is a very rare expertise available in the market.

According to Linux Foundation’s 2017 report, approximately 15,600 developers from 1,400 companies across the globe, have contributed to the Linux Kernel.

Of course, this number of Linux Developers is very small in comparison to other categories of development.
I am one of the rare developers in the world who has expertise in Linux Kernel Development.

In this article I am going to cover few more details about Linux Kernel Development and how to become a successful Kernel Developer.

If you are new to the Kernel Development thing, then I would suggest you to read this very thoroughly to understand what is this and why to pursue this.

Why to Learn Linux Kernel Development? And Why Only Linux?

Why Linux?

Because when Linus Torvalds launched Linux it was FREE from day 1. And it is a community driven project.

So, if you become an expert, you can contribute to the Linux kernel community.

Most, if not all, of the enterprise servers, data centers etc. are now running on Linux, which means there are abundant usage.

Plus, Android now runs on billions of devices which runs Linux at its core.

So, the answer to the first question is: you get a high chance to be hired by an enterprise solution company or a hardware product development company.

Linux is popular in the industry or enterprise space, which means you will have a huge opportunity if you know Linux Kernel development.

Linux Development opportunity

According to the hosting tribunal, the Linux usage statistics are as follows:
– 100% of Super Computers run on Linux
– 96.3% of world’s top 1 million web servers run Linux
– 90% of all cloud infrastructure run on Linux.

Now you know that there is a huge opportunity for Linux driver developers, Linux Sys Admins, or any Linux related job.

What Exactly is Linux Kernel Development?

Many of us understand that Linux is an Operating System but it is just a kernel.

Which is just the heart of an OS and not the OS itself. For example: Android is an OS which is built on top of Linux Kernel.

That is we say Linux Kernel Development and not Linux OS Development, right?

Basic Understanding
Any of our development contribution that goes into the Linux kernel is basically known as the Kernel development or kernel programming.

So, what is there inside a Linux Kernel?
Let’s take an example of an Android phone. What’s inside an Android Phone which runs on Linux Kernel?
– Qualcomm, or Mediatek or Exynos Chipset
– Camera module (a device)
– Sensors (devices)
– Display (a device)
– Digitizer (the touch device on a screen)
– Speakers (a device)
– etc.

The Linux Kernel of a phone includes the Initialization and configuration for the Chipset (Qualcomm, etc.) and the device drivers for each of the hardware I mentioned above.

You may have to understand how a system call works, process scheduler, memory management etc.

So, as a Kernel developer, you may have to develop driver code for a specific device on the Linux kernel or you may have to write your own system call interface, etc.

Of course there are other development areas, but these are the major areas of development for which companies hire developers having a deep understanding of how the Linux kernel works.

What are the Job Oppportunities if you know Linux Kernel Development?

Someone having kernel experience knows exactly how it is different than the normal user space application development.

A Linux Kernel Developer is typically a person who deals majorly with the core Linux Kernel functionalities.

In real world, these are the device drivers, Board Support Packages (BSP), etc.

Many embedded system product companies are looking for these Developers.

Linux is taken as a base for the interview but the candidate may get a job in a firmware project, enterprise linux development project (OpenSuse, RedHat etc.) or other OS development like FreeBSD projects (Netflix, whose infrastructure runs on FreeBSD) etc.

Some product based companies for such developers:
– Intel
– Qualcomm
– Broadcom
– Juniper
– Cisco
– Samsung
– Motorola
– TOSHIBA
– Infineon
– STErricsson
– RedHat
– IBM
– Vmware
– Oracle
– Dell
– Lenovo
– Western Digital
– etc.

I have listed a very few number of companies. There are hundreds of product based companies which may offer you a job if you are skillful in Linux Kernel Development.

What’s the Salary for a Linux Kernel Developer?

This is a variable thing. There is no straight answer to this question.

The salary primarily depends more on the company and the negotiation the candidate makes with the offering company.

Below are some of the references from various trusted sources:
– Rs. 1,00,000 base salary in India (Glassdoor.in)
– Rs. 15 lakhs avg salary in India (payscale.com)
– ~ USD 160,000 per year (ziprecruiter.com)

I am a developer in this exact industry from India, so I know that the above values are more or less close to the real life values.

This is an industry with a very good pay scale but you must understand that you need to put countless hours to learn things from book and practically on your Linux system.

Let’s now look at some of the resources needed to learn like books, online courses etc.

Now, How to Learn Linux Kernel Development?

The most important question!

Before learning Linux kernel development, you must be good at C programming and executing commands on Linux Shell prompt.
There is no escape from this.
Period!

There is no shortcut to learn Linux kernel programming. You need to get the ideas from the text books, you need to visualize the actual concepts, and most importantly you need to practice and code on your own Linux machine.

So, once you understand what you need to do, there are the below resources I recommend you to buy or download or enroll for free (if available).

The world is moving towards the online education space after this Covid-19 pandemic. There could be more online resources available in the future.

But as of now, these are the best resources available to learn Linux Kernel Development.

Linux Kernel Development by Robert Love (Book)

LKD book

This is the very first book that I recommend you to buy.

This book specifically explains the Linux kernel in a very simple way. It has pictorial presentation to make you understand about a specific topic.

Basically this book explains what is a Linux kernel and what and how exactly is the Kernel manages the so many programs, their memory space, etc.

What you will get to learn from this book?

  • Understanding Linux kernel source tree
  • The system call interface
  • The IPC mechanism
  • Memory management in Linux
  • Kernel Synchronization methods
  • Kernel debugging techniques
  • Process management
  • Process scheduler
  • IO schedulers

Personally, I have covered most of the chapters from the 3rd Edition of Robert Love’s LKD book.

Linux Device Drivers (Book)

LDD book

From the Robert Love’s LKD book you will learn about the basic OS services offered by the Linux Kernel.

Now it’s time to use those concepts in realtime to learn how to code a driver.

Once you understand how the Linux Kernel manages different processes, different services, interrupts etc. you can learn to understand how and when to use a service while writing driver code for a device.

A driver code is a piece of code (and not a standalone program like an application) that is meant to run a specific hardware or we call it a device and it resides in the kernel.

The LDD book is a source code based practical oriented book.

Let’s look at the content base of this book and what you will learn out of it:

  • How to build and run a kernel module
  • Different types of drivers in Linux
  • Debugging techniques
  • What is race condition and how to handle them
  • Memory allocation
  • Allowing user space to communicate with hardware (the IOCTL interface)
  • Kernel data structures and Datatypes
  • Understangin PCI, USB, network, Block drivers, etc.
  • Memory mapping and DMA

The whole code is written with source codes around and hence highly recommended.

You need to have a Linux computer to run your own piece of driver code to see how things really work.

Add-on: Operating Systems by Charles Crowley (Book)

OS book

This book: OPERATING SYSTEMS : A DESIGN-ORIENTED APPROACH by Charles Crowley is one of the best book to understand how and Operating system works.

This is book is not entirely needed but is one of the most useful book in your journey towards the learning Linux kernel development.

This book explains certain things in so detailed way, I am sure you have never ever learned the same way. No other books nor any other teacher or class.

Linux Kernel Development Course – by Linux Foundation

A Beginner’s Guide to Linux Kernel Development, is a free online course offered by Linux Foundation.
Course Id: LFD103

This course is instructed by Shuah Khan, a Linux Kernel Fellow at Linux Kernel Foundation and an experienced Linux Kernel developer, maintainer, and contributor.

The whole online course is covered in 12 chapters and focuses primarily on building the kernel itself rather than the core kernel internals.

What you get to learn from this course if you enroll?

  • Basic Linux Kernel Development Process
  • Source Code Patches
  • How to work with the Linux Kernel Community
  • Setting up the Development System
  • Linux Kernel code walk through
  • Building and Installing Kernel
  • How to write Kernel Patches
  • How to send it to the kernel community
  • Building Driver module, Loading it and dealing with Dependencies
  • Testing the code change

This does not tell anything about the core Linux functionalities like the process management, memory management, sys call interface, debugging techniques, how interrupts are handled, how the Linux scheduler works etc.

This course is useful once you have some basic idea of the Linux kernel internals.

I won’t recommend this for anyone to use as a single point of learning without understanding the bits and pieces of Linux kernel.

[button link=”https://training.linuxfoundation.org/training/a-beginners-guide-to-linux-kernel-development-lfd103/” size=”large” icon=”fa-film” side=”center” target=”blank” color=”d18400″ textcolor=”ffffff”]Kernel Development Online Course (FREE)[/button]

Final Words

I am a driver developer and a firmware developer with an experience of 9 years in the industry.

I can understand some of the pain points beginners or even experienced developers go through while understanding the Linux Kernel.

There might be days of struggle initially. There is nothing to worry. That’s normal!

Just remember, I am always here to help you out.

Leave a comment with your query(ies) or concern(s) and I will try my best to address you as soon as possible.

Keep learning and keep succeeding!

1 thought on “How to Learn Linux Kernel Development – Books and FREE Online Course”

  1. Thanks a lot for this post. Im a total newbie but I would love to create my own custom OS especially on Arch. Hope understanding kernel development might help a lot with the process.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.