Kernel

What is Linux?

Linux is a clone of the operating system Unix, written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX and Single UNIX Specification compliance.

It has all the features you would expect in a modern fully-fledged Unix, including true multitasking, virtual memory, shared libraries, demand loading, shared copy-on-write executables, proper memory management, and multistack networking including IPv4 and IPv6.

It is distributed under the GNU General Public License v2 – see the accompanying COPYING file for more details.

On what hardware does it run?

Although originally developed first for 32-bit x86-based PCs (386 or higher), today Linux also runs on (at least) the Compaq Alpha AXP, Sun SPARC and UltraSPARC, Motorola 68000, PowerPC, PowerPC64, ARM, Hitachi SuperH, Cell, IBM S/390, MIPS, HP PA-RISC, Intel IA-64, DEC VAX, AMD x86-64 Xtensa, and ARC architectures.

Linux is easily portable to most general-purpose 32- or 64-bit architectures as long as they have a paged memory management unit (PMMU) and a port of the GNU C compiler (gcc) (part of The GNU Compiler Collection, GCC). Linux has also been ported to a number of architectures without a PMMU, although functionality is then obviously somewhat limited. Linux has also been ported to itself. You can now run the kernel as a userspace application – this is called UserMode Linux (UML).


Kernel

The Linux kernel is an extremely important part of the software on nearly every Android device. This section describes Linux kernel development and release models (below), stable and long-term supported (LTS) kernels(including why all Android devices should use stable releases instead of cherry picking patches), kernelconfiguration and hardening, requirements for interfaces and the modular kernels (introduced in Android O), kernel debugging and network testing, and SquashFS.

Linux kernel development

The Linux kernel is the largest collaborative software project ever. In 2016, over 4,000 different developers from over 450 different companies contributed to the project and there were 6 releases, each containing between 12,000 and 16,000 different changes. At the end of 2016 the size of the Linux kernel was just over 56 thousand files, consisting of 22 million lines of code, build scripts, and documentation (kernel release 4.9). (For full Linux development statistics, refer to https://kernelnewbies.org/DevelopmentStatistics.)

While the Linux kernel contains code for all the different chip architectures and hardware drivers it supports, an individual system runs only a fraction of the codebase. An average laptop uses around 2 million lines of kernel code from 5 thousand files to function properly, while the Pixel phone uses 3.2 million lines of kernel code from 6 thousand files (due to the increased complexity of an SoC).

Linux kernel releases

The Linux kernel uses a release model that differs substantially from standard AOSP releases. With the release of the 2.6 kernel in December of 2003, the kernel developer community switched from the previous model of having a separate development and stable kernel branch, and moved to a stable only branch model. In this model, a new release occurred every 2 to 3 months, and that release was declared stable and recommended for all users to run. This change in development model was due to the very long release cycle prior to the 2.6 kernel (almost 3 years), and the struggle to maintain two different branches of the codebase at the same time.

The numbering of the kernel releases began at 2.6.x, where x was an incrementing number that changed on every release (the value of the number has no meaning, other than it is newer than the previous kernel release). The kernel version since then has now moved to 4.x accounting for 2 major version changes. These version numbers are chosen by the maintainer(s) only to avoid confusion among users caused by higher minor release numbers.

Leave a Reply

Your email address will not be published. Required fields are marked *