The Linux kernel is a free and open-source Unix-like kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the kernel for the GNU operating system (OS), which was created to be a free replacement for Unix. Since the late 1990s, it has been included in many operating system distributions, many of which are called Linux. One such Linux kernel operating system is Android, which is used in many mobile and embedded devices.
Most of the kernel code is written in C as supported by the GNU Compiler Collection (GCC), which has extensions beyond standard C. The code also contains assembly code for architecture-specific logic such as optimizing memory use and task execution. The kernel has a modular design such that modules can be integrated as software components – including dynamically loaded. The kernel is monolithic in an architectural sense since the entire OS kernel runs in kernel space.
Linux is provided under the GNU General Public License version 2, although it contains files under other compatible licenses.
History
In 1991, Linus Torvalds was a computer science student enrolled at the University of Helsinki. During his time there, he began to develop an operating system as a side-project inspired by UNIX, for a personal computer. He started with a task switcher in Intel 80386 assembly language and a terminal driver. On 25 August 1991, Torvalds posted the following to comp.os.minix, a newsgroup on Usenet:
I\'m doing a (free) operating system (just a hobby, won\'t be big and professional like gnu) for 386(486) AT clones. This has been brewing since April, and is starting to get ready. I\'d like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).I\'ve currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I\'ll get something practical within a few months [...]Yes - it\'s free of any minix code, and it has a multi-threaded fs. It is NOT protable [sic] (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that\'s all I have :-(.
On 17 September 1991, Torvalds prepared version 0.01 of Linux and put on the "ftp.funet.fi" – FTP server of the Finnish University and Research Network (FUNET). It was not even executable since its code still needed Minix to compile and test it.
On 5 October 1991, Torvalds announced the first "official" version of Linux, version 0.02.
[As] I mentioned a month ago, I\'m working on a free version of a Minix-lookalike for AT-386 computers. It has finally reached the stage where it\'s even usable (though may not be depending on what you want), and I am willing to put out the sources for wider distribution. It is just version 0.02...but I\'ve successfully run bash, gcc, gnu-make, gnu-sed, compress, etc. under it.
At the time, the GNU Project had completed many components for its free UNIX replacement, GNU, but its kernel, the GNU Hurd, was incomplete. The project adopted the Linux kernel for its OS.
Torvalds labeled the kernel with major version 0 to indicate that it was not yet intended for general use. Version 0.11, released in December 1991, was the first version to be self-hosted; compiled on a computer running the Linux kernel.
When Torvalds released version 0.12 in January 1992, he adopted the GNU General Public License version 2 (GPLv2) over his previous self-drafted license, which had not permitted commercial redistribution. GPL took effect as of 1 February 1992. In contrast to Unix, all Linux source files are freely available, including device drivers.
The initial success of Linux was driven by programmers and testers across the world. Because Linux implemented Unix-like system call semantics and exposed the standard POSIX APIs through an implementation of the C standard library, Linux could run software and applications that had been originally developed for Unix.
On 19 January 1992, the first post to the new newsgroup alt.os.linux was submitted. On 31 March 1992, the newsgroup was renamed comp.os.linux.
The fact that Linux is a monolithic kernel rather than a microkernel was the topic of a debate between Andrew S. Tanenbaum, the creator of MINIX, and Torvalds. The Tanenbaum–Torvalds debate started in 1992 on the Usenet group comp.os.minix as a general discussion about kernel architectures.
Version 0.96 released in May 1992 was the first capable of running the X Window System. In March 1994, Linux 1.0.0 was released with 176,250 lines of code. As indicated by the version number, it was the first version considered suitable for a production environment. In June 1996, after release 1.3, Torvalds decided that Linux had evolved enough to warrant a new major number, and so labeled the next release as version 2.0.0. Significant features of 2.0 included symmetric multiprocessing (SMP), support for more processors types and support for selecting specific hardware targets and for enabling architecture-specific features and optimizations. The make *config family of commands of kbuild enable and configure options for building ad hoc kernel executables (vmlinux) and loadable modules.
Version 2.2, released on 20 January 1999, improved locking granularity and SMP management, added m68k, PowerPC, Sparc64, Alpha, and other 64-bit platforms support. Furthermore, it added new file systems including Microsoft\'s NTFS read-only capability. In 1999, IBM published its patches to the Linux 2.2.13 code for the support of the S/390 architecture.
Version 2.4.0, released on 4 January 2001, contained support for ISA Plug and Play, USB, and PC Cards. Linux 2.4 added support for the Pentium 4 and Itanium (the latter introduced the ia64 ISA that was jointly developed by Intel and Hewlett-Packard to supersede the older PA-RISC), and for the newer 64-bit MIPS processor. Development for 2.4.x changed a bit in that more features were made available throughout the series, including support for Bluetooth, Logical Volume Manager (LVM) version 1, RAID support, InterMezzo and ext3 file systems.
Version 2.6.0 was released on 17 December 2003. The development for 2.6.x changed further towards including new features throughout the series. Among the changes that have been made in the 2.6 series are: integration of μClinux into the mainline kernel sources, PAE support, support for several new lines of CPUs, integration of Advanced Linux Sound Architecture (ALSA) into the mainline kernel sources, support for up to 232 users (up from 216), support for up to 229 process IDs (64-bit only, 32-bit architectures still limited to 215), substantially increased the number of device types and the number of devices of each type, improved 64-bit support, support for file systems that support file sizes of up to 16 terabytes, in-kernel preemption, support for the Native POSIX Thread Library (NPTL), User-mode Linux integration into the mainline kernel sources, SELinux integration into the mainline kernel sources, InfiniBand support, and considerably more.
Starting with 2.6.x releases, the kernel supported a large number of file systems. Some were designed for Linux, like ext3, ext4, FUSE, and Btrfs. Others were native to other operating systems like JFS, XFS, Minix, Xenix, Irix, Solaris, System V, Windows, and MS-DOS.
Though development had not used a version control system thus far, in 2002, Linux developers adopted BitKeeper, which was made freely available to them even though it was not free software. In 2005, because of efforts to reverse-engineer it, the company that owned the software revoked its support of the Linux community. In response, Torvalds and others wrote Git. The new system was written within weeks, and in two months the first official kernel made using it was released.
In 2005 the stable team was formed as a response to the lack of a kernel tree where people could work on bug fixes, and it would keep updating stable versions. In February 2008 the linux-next tree was created to serve as a place where patches aimed to be merged during the next development cycle gathered. Several subsystem maintainers also adopted the suffix -next for trees containing code that they mean to submit for inclusion in the next release cycle. As of January 2014, the in-development version of Linux is held in an unstable branch named linux-next.
The 20th anniversary of Linux was celebrated by Torvalds in July 2011 with the release of version 3.0.0. As 2.6 had been the version number for 8 years, a new uname26 personality that reports 3.x as 2.6.40+x had to be added to the kernel so that old programs would work.
Version 3.0 was released on 22 July 2011. On 30 May 2011, Torvalds announced that the big change was "NOTHING. Absolutely nothing." and asked, "...let\'s make sure we really make the next release not just an all new shiny number, but a good kernel too." After the expected 6–7 weeks of the development process, it would be released near the 20th anniversary of Linux.
On 11 December 2012, Torvalds decided to reduce kernel complexity by removing support for i386 processors—specifically by not having to emulate the atomic CMPXCHG instruction introduced with the i486 to allow reliable mutexes—making the 3.7 kernel series the last one still supporting the original processor. The same series unified support for ARM processors.
The numbering change from 2.6.39 to 3.0, and from 3.19 to 4.0, involved no meaningful technical differentiation; the major version number was increased simply to avoid large minor numbers. Stable 3.x.y kernels were released until 3.19 in February 2015. Version 3.11, released on 2 September 2013, added many new features such as the new O_TMPFILE flag for open(2) to reduce temporary file vulnerabilities, experimental AMD Radeon dynamic power management, low-latency network polling, and zswap (compressed swap cache).
In April 2015, Torvalds released kernel version 4.0. By February 2015, Linux had received contributions from nearly 12,000 programmers from more than 1,200 companies, including some of the world\'s largest software and hardware vendors. Version 4.1 of Linux, released in June 2015, contains over 19.5 million lines of code contributed by almost 14,000 programmers.
Linus Torvalds announced that kernel version 4.22 would instead be numbered 5.0 in March 2019, stating that "\'5.0\' doesn\'t mean anything more than that the 4.x numbers started getting big enough that I ran out of fingers and toes." It featured many major additions such as support for the AMD Radeon FreeSync and NVIDIA Xavier display, fixes for F2FS, EXT4 and XFS, restored support for swap files on the Btrfs file system and continued work on the Intel Icelake Gen11 graphics and on the NXP i.MX8 SoCs. This release was noticeably larger than the rest, Torvalds mentioning that "The overall changes for all of the 5.0 release are much bigger."
A total of 1,991 developers, of whom 334 were first-time collaborators, added more than 553,000 lines of code to version 5.8, breaking the record previously held by version 4.9.
Popularity
According to the Stack Overflow\'s annual Developer Survey of 2019, more than 53% of all respondents have developed software for Linux and about 27% for Android, although only about 25% develop with Linux-based operating systems.
Most websites run on Linux-based operating systems, and all of the world\'s 500 most powerful supercomputers run on Linux.
Linux distributions bundle the kernel with system software (e.g., the GNU C Library, systemd, and other Unix utilities and daemons) and a wide selection of application software, but their usage share in desktops is low in comparison to other operating systems.
Android, which runs on a modified Linux kernel, accounts for the majority of mobile device operating systems, and is increasingly being used in embedded devices, making it a significant driver of Linux adoption.
Value
The cost to redevelop version 2.6.0 of the Linux kernel in a traditional proprietary development setting has been estimated to be US$612 million (€467M, £394M) in 2004 prices using the COCOMO person-month estimation model. In 2006, a study funded by the European Union put the redevelopment cost of kernel version 2.6.8 higher, at €882M ($1.14bn, £744M).
This topic was revisited in October 2008 by Amanda McPherson, Brian Proffitt, and Ron Hale-Evans. Using David A. Wheeler\'s methodology, they estimated redevelopment of the 2.6.25 kernel now costs $1.3bn (part of a total $10.8bn to redevelop Fedora 9). Again, Garcia-Garcia and Alonso de Magdaleno from University of Oviedo (Spain) estimate that the value annually added to kernel was about €100M between 2005 and 2007 and €225M in 2008, it would cost also more than €1bn (about $1.4bn as of February 2010) to develop in the European Union.
As of 7 March 2011, using then-current LOC (lines of code) of a 2.6.x Linux kernel and wage numbers with David A. Wheeler\'s calculations it would cost approximately $3bn (about €2.2bn) to redevelop the Linux kernel as it keeps getting bigger. An updated calculation as of 26 September 2018, using then-current 20,088,609 LOC (lines of code) for the 4.14.14 Linux kernel and the current US national average programmer salary of $75,506 show that it would cost approximately $14,725,449,000 (£11,191,341,000) to rewrite the existing code.
Distribution
Most who use Linux do so via a Linux distribution. Some distributions ship the vanilla or stable kernel. Several vendors (such as Red Hat and Debian) maintain a customized source tree. These are usually updated at a slower pace than the vanilla branch, and they usually include all fixes from the relevant stable branch, but at the same time they can also add support for drivers or features that had not been released in the vanilla version the distribution vendor started basing its branch from.
Developers
Community
The community of Linux kernel developers comprises about 5000–6000 members. According to the "2017 State of Linux Kernel Development", a study issued by the Linux Foundation, covering the commits for the releases 4.8 to 4.13, about 1500 developers were contributing from about 200–250 companies on average. The top 30 developers contributed a little more than 16% of the code. For companies, the top contributors are Intel (13.1%) and Red Hat (7.2%), Linaro (5.6%), IBM (4.1%), the second and fifth places are held by the \'none\' (8.2%) and \'unknown\' (4.1%) categories.
"Instead of a roadmap, there are technical guidelines. Instead of a central resource allocation, there are persons and companies who all have a stake in the further development of the Linux kernel, quite independently from one another:
People like Linus Torvalds and I don’t plan the kernel evolution. We don’t sit there and think up the roadmap for the next two years, then assign resources to the various new features. That\'s because we don’t have any resources. The resources are all owned by the various corporations who use and contribute to Linux, as well as by the various independent contributors out there. It\'s those people who own the resources who decide..."
Conflict
In July 2007, Con Kolivas announced that he would cease developing for the Linux kernel.
In July 2009, Alan Cox quit his role as the TTY layer maintainer after disagreement with Torvalds.
In December 2010, there was a discussion between Linux SCSI maintainer James Bottomley and SCST maintainer Vladislav Bolkhovitin about which SCSI target stack should be included in the Linux kernel. This made some Linux users upset.