Useful resources for Linux kernel development
Linux is an open-source operating system that powers a vast array of devices, from smartphones to supercomputers. The kernel is at the heart of the Linux operating system and is responsible for managing system resources, such as memory and CPU. Developing the Linux kernel requires a deep understanding of computer architecture and operating system design. In this blog post, we will discuss resources that can help you get started with Linux kernel development.
Understanding the Linux Kernel
Before diving into kernel development, it is essential to have a solid understanding of the Linux kernel’s architecture and design. The book “Understanding the Linux Kernel” by Daniel P. Bovet and Marco Cesati is an excellent resource for this purpose. The book covers all aspects of kernel design, including process scheduling, memory management, and file systems. The book is written in a clear and concise manner and is suitable for both beginners and advanced developers.
Kernel Newbies is a website dedicated to helping new developers get started with Linux kernel development. The website provides a wealth of resources, including tutorials, articles, and a glossary of kernel-related terms. The website also has a mailing list where developers can ask questions and get answers from experienced kernel developers. Kernel Newbies is an excellent resource for anyone looking to get started with Linux kernel development.
LWN.net is a website that covers the latest developments in the Linux kernel and other open-source projects. The website has a section dedicated to kernel development, which includes articles, tutorials, and news. The website also has a weekly newsletter that covers the latest developments in the Linux kernel. LWN.net is an excellent resource for both beginners and advanced developers looking to stay up-to-date with the latest developments in the Linux kernel.
Linux Kernel Development
These are the top-level folders in the Linux source code:
- arch: contains architecture-specific code, with a specific sub-folder for each architecture (e.g. arm, arm64, x86).
- block: contains block subsystem code that deals with reading and writing data from block devices, creating block I/O requests, scheduling them (using one of several available I/O schedulers), merging requests, and passing them down through the I/O stack to the block device drivers.
- certs: implements support for signature checking using certificates.
- crypto: software implementation of various cryptography algorithms, as well as a framework that allows offloading such algorithms to hardware.
- Documentation: documentation for various subsystems, Linux kernel command-line options, descriptions of sysfs files and formats, and device tree bindings (supported device tree nodes and formats).
- drivers: drivers for various devices, as well as the Linux driver model implementation (an abstraction that describes drivers, devices, buses, and the way they are connected).
- firmware: binary or hex firmware files that are used by various device drivers.
- fs: home of the Virtual Filesystem Switch (generic filesystem code) and various filesystem drivers.
- include: header files.
- init: the generic (as opposed to architecture-specific) initialization code that runs during boot.
- ipc: implementation for various Inter-Process Communication system calls, such as message queues, semaphores, and shared memory.
- kernel: process management code (including support for kernel threads and work queues), scheduler, tracing, time management, generic IRQ code, and locking.
- lib: various generic functions, such as sorting, checksums, compression and decompression, bitmap manipulation, etc.
- mm: memory management code for both physical and virtual memory, including the page, SL*B and CMA allocators, swapping, virtual memory mapping, process address space manipulation, etc.
- net: implementation for various network stacks, including IPv4 and IPv6, BSD socket implementation, routing, filtering, packet scheduling, bridging, etc.
- samples: various driver samples.
- scripts: parts of the build system, scripts used for building modules, kconfig (the Linux kernel configurator), as well as various other scripts (e.g.
checkpatch.pl) that checks if a patch is conforming to the Linux kernel coding style.
- security: home of the Linux Security Module framework that allows extending the default (Unix) security model, as well as implementation for multiple such extensions such as SELinux, Smack, AppArmor, Tomoyo, etc.
- sound: home of ALSA (Advanced Linux Sound System), as well as the old Linux sound framework (OSS).
- tools: various user-space tools for testing or interacting with Linux kernel subsystems.
- usr: support for embedding an initrd file in the kernel image.
- virt: home of the KVM (Kernel Virtual Machine) hypervisor.