Introduction to Linux Kernel Development

Introduction to Linux Kernel Development
Page content

What is a Kernel

Before you get into the basics of Linux kernel development, it only makes sense to know what exactly what a kernel is. The kernel as refers to the operating system, is the core of common large computer operating systems. The kernel can be said to be the layer that sits between the operating system and its applications and the hardware, devices and memory.

Programming Languages

Just like any software application and system, the Linux kernel requires programming knowledge to be able to do any development on it. Linux kernel development requires that you primarily have a good understanding of the C programming language specifically with the C version used by the GCC compiler. Other programming languages you can use to develop on the Linux kernel include Assembly Language and in fewer cases C++ and FORTRAN for device drivers as well as other languages such as Python. It is however highly recommended to stick to C with the GCC extension and Assembly whenever needed.

Getting the Linux Kernel Source Code

Of course without the Linux kernel source code you cannot do much development on it. There are basically two main ways you can get the Linux kernel source code. Depending on your reasons for wanting to get involved in Linux kernel development, either of the following methods may be the preferred method. If you want to do stand alone or localized development then the best thing is to download the latest source code version from the official Linux kernel website.

If you want to be actively involved in the community development of the Linux kernel then your best choice is to link to the source repositories using GIT source code control system which can be installed from the same website.

Development Tools

To be able to do any development on the Linux kernel you would need to have the right tools. Naturally, the environment for Linux kernel development starts off with having a development machine running the Linux operating system. Fortunately in most cases, installations of Linux come with all the necessary tools you would need to develop the Linux kernel. The only thing here is to make sure you constantly update your development tools and libraries from your operating system’s software repository.

As far as tools go, you would need an editor to write your C code. There are several options out there but the most commonly used on you Linux system is Emacs and Vi. Once your C code has been written, you will need to be able to compile your code. In this case you would be using the GCC compiler. This is the bare minimum that you would require before you can do any Linux kernel development. Here is a guide on how to compile and install a custom Linux kernel.

Important Notes on the Linux Kernel Development

The Linux Kernel is extremely complex and requires one to be proficient in programming before you can make any attempt to make something useful out of it. The kernel is responsible for the management of hardware such as the I/O, the CPU, memory, disk controllers, network controllers and user peripherals among others. It is also responsible for system security, file access, processes, threading and a host of other features. A lot of what is required to develop on the Linux kernel in terms of the learning curve of the tools and programming languages requires years if not months of learning and practice to be able to become proficient. All of which are beyond the scope of this article. Linux Kernel development is a task not for the individual but a community as a whole.

References

Source:

Author’s own experience.

The Linux Kernel, www.kernel.org

The GNU Compiler Collection, gcc.gnu.org

Image Credit: Conan at en.wikipedia [CC-BY-3.0 (www.creativecommons.org/licenses/by/3.0), GFDL (www.gnu.org/copyleft/fdl.html) or CC-BY-3.0 (www.creativecommons.org/licenses/by/3.0)], from Wikimedia Commons, commons.wikimedia.org/wiki/File:Linux_kernel_map.png