Linux kernel#Maintenance and long-term support
{{Short description|Free Unix-like operating system kernel}}
{{Use dmy dates|date=April 2024}}
{{Infobox software
| name = Linux
| title = Linux Kernel
| logo = File:Tux.svg
| logo caption = Tux the penguin, mascot of Linux{{cite web|date=2008 |title=Linux Logos and Mascots |publisher=Linux Online |url=http://ww/logos.html |access-date=19 September 2024|archive-url=https://web.archive.org/web/20100815085106/http://www.linux.org/info/logos.html |archive-date=15 August 2010 |url-status=dead}}
| screenshot = File:Linux 6.1.0-27 kernel (running on Debian Bookworm).png
| caption = Linux kernel 6.1.0 kernel booting, under Debian
| developer = Community contributors
Linus Torvalds
| programming language = C (C11 since 5.18, C89 before),{{cite web |url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e8c07082a810f |title=Kbuild: move to -std=gnu11 |first=Arnd |last=Bergmann |date=3 March 2022 |website=git.kernel.org}}
Assembly language,
Rust,others
| released = 0.02 ({{Start date and age|1991|10|5|df=yes}})
| latest release version = {{wikidata|property|preferred|references|edit|Q14579|P348|P548=Q2804309}}
| latest release date = {{wikidata|qualifier|preferred|single|Q14579|P348|P548=Q2804309|P577}}
| latest preview version = {{wikidata|property|preferred|references|edit|Q14579|P348|P548=Q1072356}}
| latest preview date = {{wikidata|qualifier|preferred|single|Q14579|P348|P548=Q1072356|P577}}
| language = English
| license = GPL-2.0-only with Linux-syscall-note{{cite web|url=https://spdx.org/licenses/GPL-2.0-only.html|title=GPL-2.0-only|website=spdx.org|access-date=2 September 2021}}{{cite web|url=https://spdx.org/licenses/Linux-syscall-note.html|title=Linux-syscall-note|website=spdx.org|access-date=2 September 2021}}{{efn|As a whole, Linux source is provided under the terms of the GPL-2.0-only license with an explicit syscall exception.{{cite web|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/LICENSES/preferred/GPL-2.0|title=GPL-2.0|website=git.kernel.org}}{{cite web|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/LICENSES/exceptions/Linux-syscall-note|title=Linux-syscall-note|website=git.kernel.org}} Aside from that, individual files can be provided under a different license which is required to be compatible with the GPL-2.0-only license (i.e., the GNU General Public License version 2) or a dual license, with one of the choices being the GPL version 2 or a GPLv2 compatible license.{{cite web|url=https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing|title=Linux kernel licensing rules — The Linux Kernel documentation|website=www.kernel.org|access-date=6 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065451/https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing|url-status=live}}}}
| author = Linus Torvalds
}}
The Linux kernel is a free and open source,{{Cite book |last=Love |first=Robert |title=Linux kernel development |publisher=Addison-Wesley |year=2010 |isbn=978-0-672-32946-3 |edition=3rd |location=Upper Saddle River, NJ |oclc=268788260 |author-link=Robert Love}}{{Rp|page=4}} 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.{{rp|page=18}}{{cite web|title=C Extensions (Using the GNU Compiler Collection (GCC))|url=https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/C-Extensions.html#C-Extensions|access-date=13 November 2020|website=gcc.gnu.org|archive-date=20 November 2020|archive-url=https://web.archive.org/web/20201120064908/https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/C-Extensions.html#C-Extensions|url-status=live}} The code also contains assembly code for architecture-specific logic such as optimizing memory use and task execution.{{Rp|pages=379–380}} The kernel has a modular design such that modules can be integrated as software components {{endash}} 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
{{See also|History of Linux|Linux kernel version history}}
File:LinuxCon Europe Linus Torvalds 03 (cropped).jpg at the LinuxCon Europe 2014]]
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.{{cite web|last=Richardson|first=Marjorie|date=1 November 1999|title=Interview: Linus Torvalds|url=http://www.linuxjournal.com/article/3655|url-status=live|archive-url=https://web.archive.org/web/20110514084627/http://www.linuxjournal.com/article/3655|archive-date=14 May 2011|access-date=20 August 2009|publisher=Linux Journal}} 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:{{cite newsgroup |last=Torvalds |first=Linus Benedict |author-link=Linus Torvalds |date=26 August 1991 |title=What would you like to see most in minix? |newsgroup=comp.os.minix |message-id=1991Aug25.205708.9541@klaava.Helsinki.FI |url=https://groups.google.com/group/comp.os.minix/msg/b813d52cbc5a044b |access-date=14 September 2016 |archive-date=9 May 2013 |archive-url=https://web.archive.org/web/20130509134305/http://groups.google.com/group/comp.os.minix/msg/b813d52cbc5a044b |url-status=live}}
{{blockquote|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.{{Cite book|last1=Welsh|first1=Matt|title=Running Linux|last2=Dalheimer|first2=Matthias Kalle|last3=Kaufman|first3=Lar|publisher=O'Reilly Media, Inc.|year=1999|isbn=1-56592-976-4|edition=3rd|location=Sebastopol, California|oclc=50638246|page=5|chapter=1: Introduction to Linux}}
On 5 October 1991, Torvalds announced the first "official" version of Linux, version 0.02.{{cite web|url=https://groups.google.com/g/comp.os.minix/c/4995SivOl9o/m/GwqLJlPSlCEJ|title=Free minix-like kernel sources for 386-AT - Google Groups|date=5 October 1991|website=groups.google.com|access-date=19 March 2020|archive-date=1 March 2021|archive-url=https://web.archive.org/web/20210301162937/https://groups.google.com/g/comp.os.minix/c/4995SivOl9o/m/GwqLJlPSlCEJ|url-status=live}}
{{blockquote|[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.}}
Linux grew rapidly as many developers, including the MINIX community, contributed to the project.{{Citation needed|date=February 2022}} 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.{{cite book|last=Williams|first=Sam|title=Free as in Freedom: Richard Stallman's Crusade for Free Software|date=March 2002|publisher=O'Reilly|isbn=0-596-00287-4|chapter=Chapter 9: The GNU General Public License|access-date=12 November 2010|chapter-url=https://archive.org/details/freeasinfreedomr00will}}
Torvalds labeled the kernel with major version 0 to indicate that it was not yet intended for general use.{{cite book |title=LPIC-2: Linux Professional Institute Certification Study Guide: Exam 201 and Exam 202 |author= Christine Bresnahan & Richard Blum|year=2016 |publisher=John Wiley & Sons |isbn=9781119150794 |page=107}} 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 February 1992, he adopted the GNU General Public License version 2 (GPLv2) over his previous self-drafted license, which had not permitted commercial redistribution.{{cite web |last=Torvalds |first=Linus |author-link=Linus Torvalds |title=Release Notes for Linux v0.12 |publisher=The Linux Kernel Archives |url=https://www.kernel.org/pub/linux/kernel/Historic/old-versions/RELNOTES-0.12 |access-date=21 February 2007 |archive-date=19 August 2007 |archive-url=https://web.archive.org/web/20070819045030/http://www.kernel.org/pub/linux/kernel/Historic/old-versions/RELNOTES-0.12 |url-status=live}} In contrast to Unix, all source files of Linux are freely available, including device drivers.{{cite book|author=Fred Hantelmann|title=LINUX Start-up Guide: A self-contained introduction|publisher=Springer Science & Business Media|year=2016|isbn=9783642607493|page=1}}
The initial success of Linux was driven by programmers and testers across the world. With the support of the POSIX APIs, through the libC that, whether needed, acts as an entry point to the kernel address space, Linux could run software and applications that had been developed for Unix.{{cite book|author=Fred Hantelmann|title=LINUX Start-up Guide: A self-contained introduction|publisher=Springer Science & Business Media|year=2016|isbn=9783642607493|page=16}}
File:Linux kernel ubiquity.svg.]]
On 19 January 1992, the first post to the new newsgroup alt.os.linux was submitted.{{cite newsgroup |last=Summers |first=David W. |date=19 January 1992 |title=Troubles with Partitions |newsgroup=alt.os.linux |message-id=1992Jan19.085628.18752@cseg01.uark.edu |url=https://groups.google.com/group/alt.os.linux/msg/c638df159fa15159 |access-date=7 January 2007 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602210415/http://groups.google.com/group/alt.os.linux/msg/c638df159fa15159 |url-status=live}} On 31 March 1992, the newsgroup was renamed comp.os.linux.{{cite newsgroup |last=Clegg |first=Alan B. |date=31 March 1992 |title=It's here! |newsgroup=comp.os.linux |message-id=1992Mar31.131811.19832@rock.concert.net |url=https://groups.google.com/group/comp.os.linux/msg/81fe3618c4803d1e |access-date=7 January 2007 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602203914/http://groups.google.com/group/comp.os.linux/msg/81fe3618c4803d1e |url-status=live}}
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.{{cite book |date=1999 |title=Open Sources: Voices from the Open Source Revolution |chapter-url=https://archive.org/details/isbn_9781565925823 |publisher=O'Reilly |chapter=Appendix A: The Tanenbaum-Torvalds Debate |isbn=1-56592-582-3 |access-date=22 November 2006}} The Tanenbaum–Torvalds debate started in 1992 on the Usenet group comp.os.minix as a general discussion about kernel architectures.{{cite newsgroup |title=LINUX is obsolete |last=Tanenbaum |first=Andy |author-link=Andrew S. Tanenbaum |date=29 January 1992 |newsgroup=comp.os.minix |message-id=12595@star.cs.vu.nl |url=https://groups.google.com/group/comp.os.minix/msg/f447530d082cd95d |access-date=10 May 2006 |archive-date=17 October 2011 |archive-url=https://web.archive.org/web/20111017163006/http://groups.google.com/group/comp.os.minix/msg/f447530d082cd95d |url-status=live}}{{cite web |title=Tanenbaum-Torvalds Debate: Part II |url=http://www.cs.vu.nl/~ast/reliable-os/ |last=Tanenbaum |first=Andy |author-link=Andrew S. Tanenbaum |date=12 May 2006 |publisher=VU University Amsterdam |access-date=6 January 2007 |archive-date=5 August 2015 |archive-url=https://web.archive.org/web/20150805132304/http://www.cs.vu.nl/~ast/reliable-os/ |url-status=live}}
Version 0.96 released in May 1992 was the first capable of running the X Window System.{{Cite web|url=https://www.krsaborio.net/linux-kernel/research/1992/0504.html|title=0.96 out next week|website=www.krsaborio.net}}{{Cite web|url=https://kernel.googlesource.com/pub/scm/linux/kernel/git/nico/archive/+/refs/tags/v0.96a|title=refs/tags/v0.96a - pub/scm/linux/kernel/git/nico/archive - Git at Google|website=kernel.googlesource.com}} In March 1994, Linux 1.0.0 was released with 176,250 lines of code.{{cite web |last=Hayward|first=David|date=22 November 2012 |title=The history of Linux: how time has shaped the penguin |url=https://www.techradar.com/news/software/operating-systems/the-history-of-linux-how-time-has-shaped-the-penguin-1113914/2 |url-status=live |archive-url=https://web.archive.org/web/20200319065522/https://www.techradar.com/news/software/operating-systems/the-history-of-linux-how-time-has-shaped-the-penguin-1113914/2 |archive-date=19 March 2020 |access-date=26 March 2020 |website=TechRadar |language=en}} 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.{{cite book |title=LPIC-2: Linux Professional Institute Certification Study Guide: Exam 201 and Exam 202 |author= Christine Bresnahan & Richard Blum|year=2016 |publisher=John Wiley & Sons |isbn=9781119150794 |page=108}}{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/9606.1/0056.html |title=Linux 2.0 really _is_ released.. |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=9 June 1996 |mailing-list=LKML |access-date=8 March 2015 |archive-date=2 April 2015 |archive-url=https://web.archive.org/web/20150402091044/http://lkml.iu.edu/hypermail/linux/kernel/9606.1/0056.html |url-status=live}} 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.{{cite web|title=Kernel Build System — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/kbuild/index.html|access-date=17 July 2020|website=Kernel.org|archive-date=22 July 2020|archive-url=https://web.archive.org/web/20200722122129/https://www.kernel.org/doc/html/latest/kbuild/index.html|url-status=live}}{{cite web|title=Kconfig make config — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/kbuild/kconfig.html|access-date=13 September 2020|website=Kernel.org|archive-date=17 July 2020|archive-url=https://web.archive.org/web/20200717132644/https://www.kernel.org/doc/html/latest/kbuild/kconfig.html|url-status=live}}
Version 2.2, released on 20 January 1999,{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/9901.2/1084.html |title=2.2.0-final |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=20 January 1999 |mailing-list=LKML |access-date=8 March 2015 |archive-date=2 April 2015 |archive-url=https://web.archive.org/web/20150402144000/http://lkml.iu.edu/hypermail/linux/kernel/9901.2/1084.html |url-status=live}} 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.{{cite web |url=http://kniggit.net/wonderful-world-linux/wonderful-world-linux-2-2/ |title=The Wonderful World of Linux 2.2 |date=26 January 1999 |access-date=27 October 2008 |archive-date=6 November 2014 |archive-url=https://web.archive.org/web/20141106030845/http://kniggit.net/wonderful-world-linux/wonderful-world-linux-2-2/ |url-status=live}} In 1999, IBM published its patches to the Linux 2.2.13 code for the support of the S/390 architecture.{{cite web|url=http://linuxvm.org/penguinvm/notes.html|title=Linux/390 Observations and Notes|website=linuxvm.org|access-date=29 March 2020|archive-date=26 February 2019|archive-url=https://web.archive.org/web/20190226085302/http://linuxvm.org/penguinvm/notes.html|url-status=live}}
Version 2.4.0, released on 4 January 2001,{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0101.0/0776.html |title=And oh, btw.. |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=4 January 2001 |mailing-list=LKML |access-date=8 March 2015 |archive-date=26 January 2016 |archive-url=https://web.archive.org/web/20160126231619/http://lkml.iu.edu/hypermail/linux/kernel/0101.0/0776.html |url-status=live}} 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.{{cite web|url=http://kniggit.net/wwol24.html|archive-url=https://web.archive.org/web/20050317071343/http://www.kniggit.net/wwol24.html|url-status=dead|archive-date=17 March 2005|title=The Wonderful World of Linux 2.4|access-date=27 October 2008}} 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.{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0312.2/0348.html |title=Linux 2.6.0 |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=17 December 2003 |mailing-list=LKML |access-date=28 February 2015 |archive-date=2 April 2015 |archive-url=https://web.archive.org/web/20150402162542/http://lkml.iu.edu/hypermail/linux/kernel/0312.2/0348.html |url-status=live}} 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),{{cite web|url=http://man7.org/linux/man-pages/man5/proc.5.html|title=proc(5) - Linux manual page|type=see /proc/sys/kernel/pid_max|access-date=19 February 2014|archive-date=7 February 2014|archive-url=https://web.archive.org/web/20140207232837/http://man7.org/linux/man-pages/man5/proc.5.html|url-status=live}} substantially increased the number of device types and the number of devices of each type, improved 64-bit support, support for file systems which 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 designed for Linux, like ext3, ext4, FUSE, Btrfs,{{cite web|title=btrfs Wiki|url=https://btrfs.wiki.kernel.org/index.php/Main_Page|access-date=17 July 2020|website=btrfs.wiki.kernel.org|archive-date=25 April 2012|archive-url=https://web.archive.org/web/20120425151829/https://btrfs.wiki.kernel.org/|url-status=live}} and others native to other operating systems like JFS, XFS, Minix, Xenix, Irix, Solaris, System V, Windows and MS-DOS.{{cite book|author=Fred Hantelmann|title=LINUX Start-up Guide: A self-contained introduction|publisher=Springer Science & Business Media|year=2016|isbn=9783642607493|pages=1–2}}
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 which 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.{{cite mailing list |mailing-list=git-commits-head |author=Linux Kernel Mailing List |url=http://marc.info/?l=git-commits-head&m=111904216911731 |title=Linux 2.6.12 |date=17 June 2005 |access-date=23 January 2008 |archive-date=26 January 2016 |archive-url=https://web.archive.org/web/20160126231629/http://marc.info/?l=git-commits-head&m=111904216911731 |url-status=live}}
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.{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0608.0/1111.html |title=Adrian Bunk is now taking over the 2.6.16-stable branch |last=Kroah-Hartman |first=Greg |author-link=Greg Kroah-Hartman |date=3 August 2006 |mailing-list=LKML |access-date=21 February 2015 |archive-date=26 January 2016 |archive-url=https://web.archive.org/web/20160126231617/http://lkml.iu.edu/hypermail/linux/kernel/0608.0/1111.html |url-status=live}} 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.{{cite mailing list |url=https://lkml.org/lkml/2008/2/11/512 |title=Announce: Linux-next (Or Andrew's dream :-)) |last=Rothwell |first=Stephen |date=12 February 2008 |mailing-list=LKML |access-date=30 October 2010 |archive-date=24 November 2010 |archive-url=https://web.archive.org/web/20101124235700/http://lkml.org/lkml/2008/2/11/512 |url-status=live}}{{cite web |url=https://lwn.net/Articles/269120/ |title=linux-next and patch management process |last=Corbet |first=Jonathan |date=21 October 2010 |work=LWN.net |publisher=Eklektix, Inc |access-date=30 October 2010 |archive-date=21 June 2010 |archive-url=https://web.archive.org/web/20100621034215/http://lwn.net/Articles/269120/ |url-status=live}} Several subsystem maintainers also adopted the suffix -next for trees containing code which they mean to submit for inclusion in the next release cycle. {{As of|2014|January}}, the in-development version of Linux is held in an unstable branch named linux-next.{{cite web |url=http://www.kernel.org |title=The Linux Kernel Archives |publisher=Kernel.org |access-date=22 January 2014 |archive-date=30 January 1998 |archive-url=https://web.archive.org/web/19980130085039/http://www.kernel.org/ |url-status=live}}
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.{{cite web |title=Add a personality to report 2.6.x version numbers [LWN.net] |url=https://lwn.net/Articles/451168/ |website=lwn.net |access-date=15 July 2020 |archive-date=16 July 2020 |archive-url=https://web.archive.org/web/20200716092939/https://lwn.net/Articles/451168/ |url-status=live}}
Version 3.0 was released on 22 July 2011.{{cite web |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=21 July 2011 |title=Linux 3.0 release |publisher=Linux kernel mailing list |url=http://lkml.indiana.edu/hypermail/linux/kernel/1107.2/01843.html |access-date=16 May 2013 |archive-date=18 October 2019 |archive-url=https://web.archive.org/web/20191018044641/http://lkml.iu.edu/hypermail/linux/kernel/1107.2/01843.html |url-status=live}} 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."{{cite mailing list |url=http://permalink.gmane.org/gmane.linux.kernel/1147415 |title=Linux 3.0-rc1 |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=30 May 2011 |mailing-list=LKML |access-date=1 July 2013 |archive-url=https://web.archive.org/web/20110531232747/http://permalink.gmane.org/gmane.linux.kernel/1147415 |archive-date=31 May 2011 |url-status=dead }} 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{{cite web |url=https://yarchive.net/comp/linux/semaphores.html |title=Re: [PATCH] i386 rw_semaphores fix |last=Torvalds |first=Linus |date=2001-04-10 |website=yarchive.net |access-date=2024-05-26}} 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.{{cite web |url=https://www.zdnet.com/article/good-bye-386-linux-to-drop-support-for-i386-chips-with-next-major-release/ |title=Good-Bye 386: Linux to drop support for i386 chips with next major release |last=Vaughan-Nichols |first=Steven J. |date=13 December 2012 |work=ZDNet |publisher=CBS Interactive |access-date=6 February 2013 |archive-date=17 February 2015 |archive-url=https://web.archive.org/web/20150217232706/http://www.zdnet.com/article/good-bye-386-linux-to-drop-support-for-i386-chips-with-next-major-release/ |url-status=live}}{{cite web |url=https://www.engadget.com/2012/12/15/linux-to-drop-i386-support-in-the-3-8-kernel/ |title=Linux to drop i386 support in the 3.8 kernel, make us upgrade our Doom rig |last=Fingas |first=Jon |date=15 December 2012 |work=Engadget |publisher=AOL |access-date=22 March 2015 |archive-date=2 April 2015 |archive-url=https://web.archive.org/web/20150402141004/http://www.engadget.com/2012/12/15/linux-to-drop-i386-support-in-the-3-8-kernel/ |url-status=live}} The same series unified support for the ARM processor.{{cite web |url=https://www.zdnet.com/article/linux-3-7-arrives-arm-developers-rejoice/ |title=Linux 3.7 arrives, ARM developers rejoice |last=Vaughan-Nichols |first=Steven J. |date=11 December 2012 |work=ZDNet |publisher=CBS Interactive |access-date=6 February 2013 |archive-date=5 November 2014 |archive-url=https://web.archive.org/web/20141105164320/http://www.zdnet.com/linux-3-7-arrives-arm-developers-rejoice-7000008638/ |url-status=live}}
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.{{cite mailing list |url=https://lkml.org/lkml/2015/4/12/178 |title=Linux 4.0 released |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=12 April 2015 |mailing-list=LKML |access-date=12 April 2015 |archive-date=13 April 2015 |archive-url=https://web.archive.org/web/20150413015619/https://lkml.org/lkml/2015/4/12/178 |url-status=live}} Stable 3.x.y kernels were released until 3.19 in February 2015. Version 3.11, released on 2 September 2013,{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/1309.0/00650.html |title=Linux 3.11 |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=2 September 2013 |mailing-list=LKML |access-date=3 September 2013 |archive-date=26 February 2014 |archive-url=https://web.archive.org/web/20140226021932/http://lkml.iu.edu//hypermail/linux/kernel/1309.0/00650.html |url-status=live}} added many new features such as new {{Mono|O_TMPFILE}} flag for {{man|2|open|Linux||inline}} to reduce temporary file vulnerabilities, experimental AMD Radeon dynamic power management, low-latency network polling, and zswap (compressed swap cache).{{cite web |title=Linux 3.11 |url=http://kernelnewbies.org/Linux_3.11 |publisher=kernelnewbies.org |date=2 September 2013 |access-date=21 January 2014}}
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.{{cite web |date=18 February 2015 |title=The Linux Foundation Releases Linux Development Report |publisher=Linux Foundation |url=http://www.linuxfoundation.org/news-media/announcements/2015/02/linux-foundation-releases-linux-development-report |access-date=20 February 2015 |url-status=dead |archive-url=https://web.archive.org/web/20160719042639/https://www.linuxfoundation.org/news-media/announcements/2015/02/linux-foundation-releases-linux-development-report |archive-date=19 July 2016 }} Version 4.1 of Linux, released in June 2015, contains over 19.5 million lines of code contributed by almost 14,000 programmers.{{cite web |author=Michael Larabel |date=23 June 2014 |title=Linux Kernel At 19.5 Million Lines Of Code, Continues Rising |publisher=Phoronix |url=https://www.phoronix.com/scan.php?page=news_item&px=Linux-19.5M-Stats |access-date=23 June 2015 |archive-date=23 November 2020 |archive-url=https://web.archive.org/web/20201123170810/https://www.phoronix.com/scan.php?page=news_item&px=Linux-19.5M-Stats |url-status=live}}
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."{{Cite web |last=Torvalds |first=Linus |date=3 March 2019 |title=Linus Torvalds: Linux 5.0 |url=https://lkml.org/lkml/2019/3/3/236 |url-status=live |archive-url=https://web.archive.org/web/20240825123800/https://lkml.org/lkml/2019/3/3/236 |archive-date=25 August 2024 |access-date=25 August 2024 |website=LKML}} 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.{{Cite news |last=Prakash |first=Abhishek |date=11 January 2023 |title=Linux Kernel 5.0 Released! Check Out The New Features |url=https://itsfoss.com/linux-kernel-5/ |access-date=25 August 2024 |work=It's FOSS}}{{Cite web |last=Larabel |first=Micheal |date=6 January 2019 |title=The Many New Features & Improvements Of The Linux 5.0 Kernel |url=https://www.phoronix.com/review/linux-2019-features |access-date=2024-08-25 |website=www.phoronix.com |language=en}} 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.{{cite web|last=Corbet|first=Jonathan|date=3 August 2020|title=Some statistics from the 5.8 kernel cycle|url=https://lwn.net/Articles/827735/|access-date=11 August 2020|website=LWN - Linux Weekly News|archive-date=4 September 2020|archive-url=https://web.archive.org/web/20200904084101/https://lwn.net/Articles/827735/|url-status=live}}
Popularity
{{Main|Usage share of operating systems}}
According to the Stack Overflow's annual Developer Survey of 2019, more than the 53% of all respondents have developed software for Linux and about 27% for Android,{{cite web|url=https://insights.stackoverflow.com/survey/2019/|title=Stack Overflow Developer Survey 2019 - most popular technologies|website=Stack Overflow|access-date=17 March 2020|archive-date=8 October 2020|archive-url=https://web.archive.org/web/20201008033536/https://insights.stackoverflow.com/survey/2019/?utm_source=social-share&utm_medium=social&utm_campaign=dev-survey-2019|url-status=live}} although only about 25% develop with Linux-based operating systems.{{cite web|url=https://insights.stackoverflow.com/survey/2019#development-environments-and-tools|title=Stack Overflow Developer Survey 2019 - development environments and tools|website=Stack Overflow|access-date=17 March 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307082721/https://insights.stackoverflow.com/survey/2019#development-environments-and-tools|url-status=live}}
Most websites run on Linux-based operating systems,{{cite web|title=Usage Statistics and Market Share of Operating Systems for Websites, March 2020|url=https://w3techs.com/technologies/overview/operating_system|access-date=17 March 2020|website=w3techs.com}}{{cite web|title=Usage Statistics and Market Share of Unix for Websites, March 2020|url=https://w3techs.com/technologies/details/os-unix|access-date=17 March 2020|website=w3techs.com}} and all of the world's 500 most powerful supercomputers run on Linux.{{cite web|title=TOP500 Supercomputer Sites: Operating system Family / Linux|url=https://www.top500.org/statistics/details/osfam/1|access-date=5 October 2019|publisher=Top500.org|archive-date=19 November 2012|archive-url=https://web.archive.org/web/20121119205719/https://www.top500.org/statistics/details/osfam/1|url-status=live}}
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.
Since Android, which is Linux, accounts for the majority of mobile device operating systems,{{cite press release |title=Gartner Says Sales of Tablets Will Represent Less Than 10 Percent of All Devices in 2014 |url=http://www.gartner.com/newsroom/id/2875017 |location=Egham, UK |publisher=Gartner |date=15 October 2014 |access-date=19 October 2014 |archive-date=17 October 2014 |archive-url=https://web.archive.org/web/20141017151529/http://www.gartner.com/newsroom/id/2875017 |url-status=dead}}{{cite web |url=https://techcrunch.com/2014/10/15/tablet-sales-growth-plummets-in-2014-as-android-smartphones-continue-to-soar-gartner |title=Tablet Sales Growth Plummets In 2014 As Android Smartphones Continue To Soar: Gartner |last=Lunden |first=Ingrid |date=15 October 2014 |work=TechCrunch |publisher=AOL |access-date=23 October 2014 |archive-date=23 October 2014 |archive-url=https://web.archive.org/web/20141023114800/http://techcrunch.com/2014/10/15/tablet-sales-growth-plummets-in-2014-as-android-smartphones-continue-to-soar-gartner/ |url-status=live}}{{cite press release |title=Global PC Shipments Exceed Forecast with Mild Improvement in Consumer Demand, While Apple Moves to #5 Spot, According to IDC |url=http://www.idc.com/getdoc.jsp?containerId=prUS25187214 |location=Framingham, MA |publisher=IDC |date=8 October 2014 |access-date=19 October 2014 |url-status=dead |archive-url=https://web.archive.org/web/20141011215307/http://www.idc.com/getdoc.jsp?containerId=prUS25187214 |archive-date=11 October 2014 }} and due to its rising use in embedded devices, Android is significantly responsible for rising use of Linux overall.
Value
File:Redevelopment costs of Linux kernel.png
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.{{cite web |url = http://www.dwheeler.com/essays/linux-kernel-cost.html |title = Linux Kernel 2.6: It's Worth More! |last = Wheeler |first = David A. |access-date = 18 January 2007 |archive-date = 20 August 2011 |archive-url = https://web.archive.org/web/20110820092909/http://www.dwheeler.com/essays/linux-kernel-cost.html |url-status = live}} 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).{{cite web|url=http://ec.europa.eu/enterprise/sectors/ict/files/2006-11-20-flossimpact_en.pdf|title=Economic impact of FLOSS on innovation and competitiveness of the EU ICT sector|type=Table 3 on page 50|access-date=8 January 2011|archive-date=15 February 2010|archive-url=https://web.archive.org/web/20100215190539/http://ec.europa.eu/enterprise/sectors/ict/files/2006-11-20-flossimpact_en.pdf|url-status=live}}
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).{{cite web|url=http://www.linuxfoundation.org/publications/estimatinglinux.pdf|title=Estimating Total Development Cost Of a Linux Distribution|type=Table on page 6|url-status=dead|archive-url=https://web.archive.org/web/20100711025812/http://www.linuxfoundation.org/publications/estimatinglinux.pdf|archive-date=11 July 2010}} 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.{{cite web |url=http://linux.slashdot.org/story/10/02/24/155214/The-Billion-Dollar-Kernel |title=The Billion Dollar Kernel |publisher=Linux.slashdot.org |date=24 February 2010 |access-date=12 November 2010 |archive-date=15 May 2011 |archive-url=https://web.archive.org/web/20110515003125/http://linux.slashdot.org/story/10/02/24/155214/The-Billion-Dollar-Kernel |url-status=live}}
{{As of|2011|3|7}}, 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|2018|9|26|lc=y}}, 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.{{cite web|last=Wheeler|first=David|title=The Linux Kernel: It's Worth More!|url=https://dwheeler.com/essays/linux-kernel-cost.html|access-date=17 September 2012|archive-url=https://web.archive.org/web/20210224011056/https://dwheeler.com/essays/linux-kernel-cost.html |archive-date=24 February 2021 |url-status=live}}
Distribution
Most who use Linux do so via a Linux distribution. Some distributions ship the vanilla or stable kernel. However, 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 which had not been released in the vanilla version the distribution vendor started basing its branch from.
Developers
= Community =
{{stack|clear=yes|
File:Linux Kernel Sizes Graph.png
}}
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.{{cite web|title=2017 State of Linux Kernel Development|url=https://www.linuxfoundation.org/publications/2017/10/2017-state-of-linux-kernel-development/|date=25 October 2017|website=The Linux Foundation|language=en-US|access-date=27 May 2020|archive-date=27 May 2020|archive-url=https://web.archive.org/web/20200527074644/https://www.linuxfoundation.org/publications/2017/10/2017-state-of-linux-kernel-development/|url-status=live}}
{{Blockquote|text=
"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..."|sign=Andrew Morton, 2005}}
{{image frame|align=center|caption=Corporate affiliation of contributions to the Linux kernel, 4.8–4.13
|width=900
|content={{Stacked bar | height=18px | vertical_caption=
|T1=Intel|A1=13.1|C1=#0072c6
|T2=None|A2=8.2|C2=#ccc
|T3=Red Hat|A3=7.2|C3=#e00
|T4=Linaro|A4=5.6|C4=#96c72e
|T5=Unknown|A5=4.1|C5=#ccc
|T6=IBM|A6=4.1|C6=#1870c0
|T7=Consultants|A7=3.3|C7=#ccc
|T8=Samsung|A8=3.2|C8=#004da4
|T9=SUSE|A9=3|C9=#30BA78
|T10=Google|A10=3|C10=#fbbc05
|T11=nearly 500 other
companies|A11=45.2|C11=#eee}}
}}
= Conflict =
Notable conflicts among Linux kernel developers:
- In July 2007, Con Kolivas announced that he would cease developing for the Linux kernel.{{cite web |title=Why I quit: kernel developer Con Kolivas |url=http://apcmag.com/node/6735/ |access-date=15 August 2011 |date=24 July 2007 |work=APC Magazine |publisher=ACP Magazines |archive-url=https://web.archive.org/web/20110707151924/http://apcmag.com/why_i_quit_kernel_developer_con_kolivas.htm |archive-date = 7 July 2011}}{{cite web |first=Jonathan |last=Corbet |title=Re: -mm merge plans for 2.6.23 |publisher=LWN.net |date=25 July 2007 |url=https://lwn.net/Articles/242768/ |access-date=10 February 2018 |archive-date=11 February 2018 |archive-url=https://web.archive.org/web/20180211131406/https://lwn.net/Articles/242768/ |url-status=live}}
- In July 2009, Alan Cox quit his role as the TTY layer maintainer after disagreement with Torvalds.{{cite web |first=Alan |last=Cox |title=Re: [PATCH] kdesu broken |url=https://lkml.org/lkml/2009/7/28/375 |date=28 July 2009 |access-date=10 February 2018 |archive-date=11 February 2018 |archive-url=https://web.archive.org/web/20180211190040/https://lkml.org/lkml/2009/7/28/375 |url-status=live}}
- 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.{{cite web |first=Goldwyn |last=Rodrigues |title=A tale of two SCSI targets |url=https://lwn.net/Articles/424004/ |date=22 January 2011 |access-date=14 February 2018 |archive-date=15 February 2018 |archive-url=https://web.archive.org/web/20180215204201/https://lwn.net/Articles/424004/ |url-status=live}} This made some Linux users upset.{{cite web |first=Andreas |last=Steinmetz |title=LIO - the broken iSCSI target implementation |url=https://lkml.org/lkml/2013/1/16/803 |date=17 January 2013 |access-date=14 February 2018 |archive-date=15 February 2018 |archive-url=https://web.archive.org/web/20180215204140/https://lkml.org/lkml/2013/1/16/803 |url-status=live}}
- In June 2012, Torvalds made it very clear that he did not agree with NVIDIA releasing its drivers as closed.{{cite web |last=Paul |first=Ryan |date=19 June 2012 |title=Linus Torvalds says "f–k you" to NVIDIA |url=https://arstechnica.com/information-technology/2012/06/linus-torvalds-says-f-k-you-to-nvidia/ |url-status=live |archive-url=https://web.archive.org/web/20180215023959/https://arstechnica.com/information-technology/2012/06/linus-torvalds-says-f-k-you-to-nvidia/ |archive-date=15 February 2018 |access-date=14 February 2018 |language=en}}
- In April 2014, Torvalds banned Kay Sievers from submitting patches to the Linux kernel for failing to deal with bugs that caused systemd to negatively interact with the kernel.{{cite web |author=John Gold |title=Linus Torvalds suspends key Linux developer: Kernel panic as Systemd dev pokes the bear |url=https://www.networkworld.com/article/2175826/linus-torvalds-suspends-key-linux-developer.html |date=3 April 2014 |access-date=24 March 2019 |archive-date=24 March 2019 |archive-url=https://web.archive.org/web/20190324195212/https://www.networkworld.com/article/2175826/linus-torvalds-suspends-key-linux-developer.html |url-status=live}}
- In October 2014, Lennart Poettering accused Torvalds of tolerating the rough discussion style on Linux kernel related mailing lists and of being a bad role model.{{cite web |first=Lennart |last=Poettering |title=On the sickness of the Linux Kernel Community |url=https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/J2TZrTvu7vd |website=Google+ |date=6 October 2014 |access-date=10 February 2018 |archive-url=https://web.archive.org/web/20180527195108/https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/J2TZrTvu7vd |archive-date=27 May 2018 |url-status=dead}}
- In March 2015, Christoph Hellwig filed a lawsuit against VMware for infringement of the copyright on the Linux kernel.{{cite web |first=Jon |last=Brodkin |title=VMware alleged to have violated Linux's open source license for years |url=https://arstechnica.com/tech-policy/2015/03/vmware-alleged-to-have-violated-linuxs-open-source-license-for-years/ |website=Ars Technica |date=6 March 2015 |access-date=14 February 2018 |archive-date=15 February 2018 |archive-url=https://web.archive.org/web/20180215023512/https://arstechnica.com/tech-policy/2015/03/vmware-alleged-to-have-violated-linuxs-open-source-license-for-years/ |url-status=live}} Linus Torvalds made it clear that he did not agree with this and similar initiatives by calling lawyers a festering disease.{{cite web |first=Kieren |last=McCarthy |title=Having offended everyone else in the world, Linus Torvalds calls own lawyers a 'nasty festering disease' |url=https://www.theregister.co.uk/2016/08/26/linus_torvalds_calls_own_lawyers_nasty_festering_disease/ |website=The Register |date=26 August 2016 |access-date=14 February 2018 |archive-date=15 February 2018 |archive-url=https://web.archive.org/web/20180215023540/https://www.theregister.co.uk/2016/08/26/linus_torvalds_calls_own_lawyers_nasty_festering_disease/ |url-status=live}}
- In April 2021, a team from the University of Minnesota was found to be submitting "bad faith" patches to the kernel as part of its research. This resulted in the immediate reversion of all patches ever submitted by a member of the university. In addition, a warning was issued by a senior maintainer that any future patch from the university would be rejected on sight.{{cite web |last1=Kroah-Hartman |first1=Greg |title=[PATCH 000/190] Revertion of all of the umn.edu commits |url=https://lore.kernel.org/lkml/20210421130105.1226686-1-gregkh@linuxfoundation.org/ |website=Linux Kernel Mailing List Archive |access-date=13 January 2022}}{{cite news |last1=Chin |first1=Monica |title=How a university got itself banned from the Linux kernel |url=https://www.theverge.com/2021/4/30/22410164/linux-kernel-university-of-minnesota-banned-open-source |access-date=13 January 2022 |publisher=The Verge |date=30 April 2021}}
Prominent Linux kernel developers have been aware of the importance of avoiding conflicts between developers.{{cite web |first=Jonathan |last=Corbet |title=KS2007: Developer relations and development process |url=https://lwn.net/Articles/249104/ |website=LWN.net |date=10 September 2007 |access-date=11 February 2018 |archive-date=12 February 2018 |archive-url=https://web.archive.org/web/20180212142109/https://lwn.net/Articles/249104/ |url-status=live}} For a long time there was no code of conduct for kernel developers due to opposition by Torvalds.{{cite web |first=Jon |last=Brodkin |title=Linus Torvalds defends his right to shame Linux kernel developers |url=https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ |website=ARS Technica |date=16 July 2013 |access-date=11 February 2018 |archive-date=17 February 2018 |archive-url=https://web.archive.org/web/20180217143017/https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ |url-status=live}} However, a Linux Kernel Code of Conflict was introduced on 8 March 2015.{{cite web |first=Jonathan |last=Corbet |title=The kernel's code of conflict |url=https://lwn.net/Articles/635999/ |website=LWN.net |date=9 March 2015 |access-date=11 February 2018 |archive-date=12 February 2018 |archive-url=https://web.archive.org/web/20180212142143/https://lwn.net/Articles/635999/ |url-status=live}} It was replaced on 16 September 2018 by a new Code of Conduct based on the Contributor Covenant. This coincided with a public apology by Torvalds and a brief break from kernel development.{{cite web|url=https://lwn.net/SubscriberLink/765108/f1a80a6d6a6ff0f4/|title=Code, conflict, and conduct|first=Jonathan|last=Corbet|publisher=LWN.net|date=18 September 2018|access-date=19 September 2018|archive-date=19 September 2018|archive-url=https://web.archive.org/web/20180919175320/https://lwn.net/SubscriberLink/765108/f1a80a6d6a6ff0f4/|url-status=live}}{{cite magazine|url=https://www.newyorker.com/science/elements/after-years-of-abusive-e-mails-the-creator-of-linux-steps-aside|title=After Years of Abusive E-mails, the Creator of Linux Steps Aside|first=Noam|last=Cohen|magazine=The New Yorker|date=19 September 2018|access-date=24 September 2018|archive-date=20 February 2020|archive-url=https://web.archive.org/web/20200220085413/https://www.newyorker.com/science/elements/after-years-of-abusive-e-mails-the-creator-of-linux-steps-aside|url-status=live}} On 30 November 2018, complying with the Code of Conduct, Jarkko Sakkinen of Intel sent out patches replacing instances of "fuck" appearing in source code comments with suitable versions focused on the word 'hug'.{{cite web |last1=Larabel |first1=Michael |title=Dropping Profanity In Kernel Code Comments: Linux Gets "Hugs" |url=https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs |website=Phoronix |access-date=15 June 2019 |archive-date=21 April 2019 |archive-url=https://web.archive.org/web/20190421094724/https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs |url-status=live}}
Developers who feel treated unfairly can report this to the Linux Foundation Technical Advisory Board.{{cite web |title=Code of Conflict |url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/code-of-conflict.rst |access-date=4 February 2018}}{{Dead link|date=February 2020 |bot=InternetArchiveBot |fix-attempted=yes}} In July 2013, the maintainer of the USB 3.0 driver Sage Sharp asked Torvalds to address the abusive commentary in the kernel development community. In 2014, Sharp backed out of Linux kernel development, saying that "The focus on technical excellence, in combination with overloaded maintainers, and people with different cultural and social norms, means that Linux kernel maintainers are often blunt, rude, or brutal to get their job done".{{cite web |first=Simon |last=Sharwood |title=Linux kernel dev who asked Linus Torvalds to stop verbal abuse quits over verbal abuse |url=https://www.theregister.co.uk/2015/10/06/linix_kernel_dev_who_asked_linus_torvalds_to_stop_swearing_quits_over_swearing/ |website=The Register |date=6 October 2015 |access-date=4 February 2018 |archive-date=29 March 2020 |archive-url=https://web.archive.org/web/20200329075939/https://www.theregister.co.uk/2015/10/06/linix_kernel_dev_who_asked_linus_torvalds_to_stop_swearing_quits_over_swearing/ |url-status=live}} At the linux.conf.au (LCA) conference in 2018, developers expressed the view that the culture of the community has gotten much better in the past few years. Daniel Vetter, the maintainer of the Intel drm/i915 graphics kernel driver, commented that the "rather violent language and discussion" in the kernel community has decreased or disappeared.{{cite web |first=Jake |last=Edge |title=Too many lords, not enough stewards |url=https://lwn.net/Articles/745817/ |website=LWN.net |date=31 January 2018 |access-date=4 February 2018 |archive-date=9 November 2020 |archive-url=https://web.archive.org/web/20201109004145/https://lwn.net/Articles/745817/ |url-status=live}}
Laurent Pinchart asked developers for feedback on their experiences with the kernel community at the 2017 Embedded Linux Conference Europe. The issues brought up were discussed a few days later at the Maintainers Summit. Concerns over the lack of consistency in how maintainers responded to patches submitted by developers were echoed by Shuah Khan, the maintainer of the kernel self-test framework. Torvalds contended that there would never be consistency in the handling of patches because different kernel subsystems have, over time, adopted different development processes. Therefore, it was agreed upon that each kernel subsystem maintainer would document the rules for patch acceptance.{{cite web |first=Jonathan |last=Corbet |title=Bash the kernel maintainers |url=https://lwn.net/Articles/738222/ |website=LWN.net |date=6 November 2017 |access-date=4 February 2018 |archive-date=26 January 2021 |archive-url=https://web.archive.org/web/20210126003428/https://lwn.net/Articles/738222/ |url-status=live}}
Development
{{Blockquote|text=Linux is evolution, not intelligent design!|sign=Linus Torvalds, 2005{{cite web |url=http://www.sprg.uniroma2.it/kernelhacking2008/lectures/lkhc08-01b.pdf |title=Linux Evolution |date=26 March 2008 |access-date=6 November 2013 |archive-date=14 December 2013 |archive-url=https://web.archive.org/web/20131214074153/http://www.sprg.uniroma2.it/kernelhacking2008/lectures/lkhc08-01b.pdf |url-status=live}}{{cite web |url=http://www.cs.huji.ac.il/~feit/papers/LinuxDev12JSS.pdf |title=Perpetual Development: A Model of the Linux Kernel Life Cycle |date=25 October 2011 |access-date=6 November 2013 |archive-date=17 October 2013 |archive-url=https://web.archive.org/web/20131017210855/http://www.cs.huji.ac.il/~feit/papers/LinuxDev12JSS.pdf |url-status=live}}{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0802.1/2159.html |title=Re: Announce: Linux-next (Or Andrew's dream :-)) |date=12 February 2008 |access-date=30 January 2017 |mailing-list=Linux Kernel Mailing List |last=Kroah-Hartman |first=Greg |archive-date=2 February 2017 |archive-url=https://web.archive.org/web/20170202070946/http://lkml.iu.edu/hypermail/linux/kernel/0802.1/2159.html |url-status=live}}|source=}}
= Codebase =
The kernel source code, a.k.a. source tree, is managed in the Git version control system {{endash}} also created by Torvalds.{{cite book |title=Linux Kernel Development: Linux Kernel Development |author= Robert Love|year=2010 |publisher=Pearson Education |isbn=9780768696790 |page=11}}
{{As of|2021}}, the 5.11 release of the Linux kernel had around 30.34 million lines of code. Roughly 14% of the code is part of the "core," including architecture-specific code, kernel code, and memory management code, while 60% is drivers.
= Contributions =
Contributions are submitted as patches, in the form of text messages on the Linux kernel mailing list (LKML) (and often also on other mailing lists dedicated to particular subsystems). The patches must conform to a set of rules and to a formal language that, among other things, describes which lines of code are to be deleted and what others are to be added to the specified files. These patches can be automatically processed so that system administrators can apply them in order to make just some changes to the code or to incrementally upgrade to the next version.{{cite book |title=Linux Kernel Development: Linux Kernel Development |author= Robert Love|year=2010 |publisher=Pearson Education |isbn=9780768696790 |page=12}} Linux is distributed also in GNU zip (gzip) and bzip2 formats.
A developer who wants to change the Linux kernel writes and tests a code change. Depending on how significant the change is and how many subsystems it modifies, the change will either be submitted as a single patch or in multiple patches of source code. In case of a single subsystem that is maintained by a single maintainer, these patches are sent as e-mails to the maintainer of the subsystem with the appropriate mailing list in Cc. The maintainer and the readers of the mailing list will review the patches and provide feedback. Once the review process has finished the subsystem maintainer accepts the patches in the relevant Git kernel tree. If the changes to the Linux kernel are bug fixes that are considered important enough, a pull request for the patches will be sent to Torvalds within a few days. Otherwise, a pull request will be sent to Torvalds during the next merge window. The merge window usually lasts two weeks and starts immediately after the release of the previous kernel version.{{cite web |title=How the development process works |url=https://www.kernel.org/doc/html/latest/process/2.Process.html |access-date=4 February 2018 |archive-date=9 December 2017 |archive-url=https://web.archive.org/web/20171209130758/https://www.kernel.org/doc/html/latest/process/2.Process.html |url-status=live}} The Git kernel source tree names all developers who have contributed to the Linux kernel in the Credits directory and all subsystem maintainers are listed in Maintainers.{{cite book |title=Linux Kernel Development: Linux Kernel Development |author= Robert Love|year=2010 |publisher=Pearson Education |isbn=9780768696790 |page=13}}
As with many large open-source software projects, developers are required to adhere to the Contributor Covenant, a code of conduct intended to address harassment of minority contributors.{{cite web |title=Contributor Covenant Code of Conduct |url=https://www.kernel.org/doc/html/latest/process/code-of-conduct.html |website=The Linux Kernel documentation |access-date=6 October 2021}}{{cite web |title=Linux Kernel Contributor Covenant Code of Conduct Interpretation |url=https://www.kernel.org/doc/html/latest/process/code-of-conduct-interpretation.html |website=The Linux Kernel Documentation |access-date=6 October 2021}} Additionally, to prevent offense the use of inclusive terminology within the source code is mandated.{{cite web |last1=Williams |first1=Dan |title=[PATCH] CodingStyle: Inclusive Terminology |url=https://lkml.org/lkml/2020/7/4/229 |website=Linux Kernel Mailing List}}
= Programming language =
{{See also|Rust for Linux}}
Linux is written in a special C programming language supported by GCC, a compiler that extends the C standard in many ways, for example using inline sections of code written in the assembly language (in GCC's "AT&T-style" syntax) of the target architecture.
In September 2021, the GCC version requirement for compiling and building the Linux kernel increased from GCC 4.9 to 5.1, allowing the potential for the kernel to be moved from using C code based on the C89 standard to using code written with the C11 standard,{{Cite web |last=Tim Anderson |title=Linux kernel minimum compiler raised to GCC 5.1, allowing potential C11 use |url=https://www.theregister.com/2021/09/15/linux_kernel_gcc_5_1/ |access-date=12 May 2023 |website=The Register |language=en}} with the migration to the standard taking place in March 2022, with the release of Linux 5.18.{{Cite web |last=Larabel |first=Michael |title=The Switch Has Been Made From C89 To C11/GNU11 With Linux 5.18 |url=https://www.phoronix.com/news/Linux-5.18-Does-C11 |access-date=12 May 2023 |website=www.phoronix.com |language=en}}
Initial support for the Rust programming language was added in Linux 6.1{{Cite web |last=Proven |first=Liam |title=Linux 6.1: Rust to hit mainline kernel |url=https://www.theregister.com/2022/10/05/rust_kernel_pull_request_pulled/ |access-date=12 May 2023 |website=The Register |language=en}} which was released in December 2022,{{Cite web |last=Sharwood |first=Simon |title=Linus Torvalds reveals Linux kernel 6.1 |url=https://www.theregister.com/2022/12/11/linux_6_1/ |date=11 December 2022 |access-date=12 May 2023 |website=The Register |language=en}} with later kernel versions, such as Linux 6.2 and Linux 6.3, further improving the support.{{Cite web |last=Corbet |first=Jonathan |title=Rust in the 6.2 kernel |url=https://lwn.net/Articles/914458/ |access-date=12 May 2023 |website=LWN.net}}{{Cite web |last=Larabel |first=Michael |title=More Rust Code Readied For Linux 6.3 - Closer To Having Rust Drivers Upstreamed |url=https://www.phoronix.com/news/Rust-Linux-6.3-Changes |access-date=12 May 2023 |website=Phoronix |language=en}}
= Coding style =
Since 2002, code must adhere to the 21 rules comprising the Linux Kernel Coding Style.{{cite web|url=https://www.kernel.org/doc/html/latest/process/howto.html#documentation|title=HOWTO do Linux kernel development — The Linux Kernel documentation|website=Kernel.org|access-date=4 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065439/https://www.kernel.org/doc/html/latest/process/howto.html#documentation|url-status=live}}{{cite web|url=https://www.kernel.org/doc/html/latest/process/coding-style.html|title=Linux kernel coding style — The Linux Kernel documentation|website=Kernel.org|access-date=4 January 2020|archive-date=5 January 2020|archive-url=https://web.archive.org/web/20200105083545/https://www.kernel.org/doc/html/latest/process/coding-style.html|url-status=live}}
= Versioning =
As for most software, the kernel is versioned as a series of dot-separated numbers.
For early versions, the version consisted of three or four dot-separated numbers called major release, minor release and revision.{{Rp|page=9}} At that time, odd-numbered minor releases were for development and testing, while even numbered minor releases for production. The optional fourth digit indicated a patch level. Development releases were indicated with a release candidate suffix (-rc).
The current versioning conventions are different. The odd/even number implying dev/prod has been dropped, and a major version is indicated by the first two numbers together. While the time-frame is open for the development of the next major, the -rcN suffix is used to identify the n'th release candidate for the next version.{{cite web|url=https://www.kernel.org/doc/html/latest/process/2.Process.html#the-big-picture|title=How the development process works — The Linux Kernel documentation|website=Kernel.org|access-date=26 March 2020|archive-date=9 December 2017|archive-url=https://web.archive.org/web/20171209130758/https://www.kernel.org/doc/html/latest/process/2.Process.html#the-big-picture|url-status=live}} For example, the release of the version 4.16 was preceded by seven 4.16-rcN (from -rc1 to -rc7). Once a stable version is released, its maintenance is passed to the stable team. Updates to a stable release are identified by a three-number scheme (e.g., 4.16.1, 4.16.2, ...).
= Toolchain =
The kernel is usually built with the GNU toolchain. The GNU C compiler, GNU cc, part of the GNU Compiler Collection (GCC), is the default compiler for mainline Linux. Sequencing is handled by GNU make. The GNU Assembler (often called GAS or GNU as) outputs the object files from the GCC generated assembly code. Finally, the GNU Linker (GNU ld) produces a statically linked executable kernel file called {{Mono|vmlinux}}. Both {{Mono|as}} and {{Mono|ld}} are part of GNU Binary Utilities (binutils).
GNU cc was for a long time the only compiler capable of correctly building Linux. In 2004, Intel claimed to have modified the kernel so that its C compiler was also capable of compiling it.{{cite web|url=http://www.pyrillion.org/index.html?showframe=linuxkernelpatch.html |title=Linux kernel patch for Intel Compiler |last=Kubbilun |first=Ingo A. |date=2 June 2004 |publisher=Pyrillion.org |access-date=12 November 2010 |archive-url=https://web.archive.org/web/20110722090031/http://www.pyrillion.org/index.html?showframe=linuxkernelpatch.html |archive-date=22 July 2011 |language=de |url-status=dead}} There was another such reported success in 2009, with a modified 2.6.22 version.{{cite web |url=http://linux.slashdot.org/article.pl?sid=09/02/26/2216241 |title=High Performance Linux Kernel Project — LinuxDNA |author=timothy |date=26 February 2009 |work=Slashdot Linux |publisher=Dice Holdings |access-date=30 October 2010 |archive-date=18 October 2019 |archive-url=https://web.archive.org/web/20191018044639/https://linux.slashdot.org/story/09/02/26/2216241/high-performance-linux-kernel-project-linuxdna |url-status=live}}{{cite web |url=http://www.linuxjournal.com/content/linuxdna-supercharges-linux-intel-cc-compiler |title=LinuxDNA Supercharges Linux with the Intel C/C++ Compiler |last=Ryan |first=Justin |date=25 February 2009 |work=Linux Journal |publisher=Belltown Media, Inc. |access-date=30 October 2010 |archive-date=9 November 2020 |archive-url=https://web.archive.org/web/20201109011614/https://www.linuxjournal.com/content/linuxdna-supercharges-linux-intel-cc-compiler |url-status=live}} Support for the Intel compiler has been dropped in 2023.{{Cite web|title=Linux 6.3 Drops Support For The Intel ICC Compiler|url=https://www.phoronix.com/news/Linux-6.3-Drops-Intel-ICC|last=Larabel|first=Michael|date=5 March 2023|access-date=6 March 2023|website=Phoronix|language=en}}
Since 2010, effort has been underway to build Linux with Clang, an alternative compiler for the C language;{{cite mailing list| url=http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-October/011711.html |title=Clang builds a working Linux Kernel (Boots to RL5 with SMP, networking and X, self hosts) |last=Lelbach |first=Bryce |mailing-list=cfe-dev |date=25 October 2010 |archive-url=https://web.archive.org/web/20150907044958/http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-October/011711.html |archive-date=7 September 2015}} as of 12 April 2014, the official kernel could almost be compiled by Clang.{{cite web |url=https://www.phoronix.com/scan.php?page=news_item&px=MTY2MjY |title=Linux 3.15 Can Almost Be Compiled Under LLVM's Clang |last=Larabel |first=Michael |author-link=Michael Larabel |date=12 April 2014 |publisher=Phoronix |access-date=10 June 2014 |archive-date=13 August 2020 |archive-url=https://web.archive.org/web/20200813143201/https://www.phoronix.com/scan.php?page=news_item&px=MTY2MjY |url-status=live}}{{cite web |url=https://www.phoronix.com/scan.php?page=news_item&px=MTY2MjY |title=Patch By Patch, LLVM Clang Gets Better At Building The Linux Kernel |last=Larabel |first=Michael |author-link=Michael Larabel |publisher=Phoronix |access-date=20 November 2014 |archive-date=13 August 2020 |archive-url=https://web.archive.org/web/20200813143201/https://www.phoronix.com/scan.php?page=news_item&px=MTY2MjY |url-status=live}} The project dedicated to this effort is named LLVMLinux after the LLVM compiler infrastructure upon which Clang is built.{{cite web |url=https://lwn.net/Articles/549203/ |title=LFCS: The LLVMLinux project |last=Edge |first=Jake |date=7 May 2013 |publisher=LWN.net |access-date=3 March 2015 |archive-date=10 August 2020 |archive-url=https://web.archive.org/web/20200810165632/https://lwn.net/Articles/549203/ |url-status=live}} LLVMLinux does not aim to fork either Linux or the LLVM, therefore it is a meta-project composed of patches that are eventually submitted to the upstream projects. By enabling Linux to be compiled by Clang, developers may benefit from shorter compilation times.{{cite web |url=http://llvm.org/devmtg/2014-02/slides/moller-llvmlinux.pdf |title=LLVMLinux: The Linux Kernel with Dragon Wings |last=Möller |first=Jan-Simon |date=2 February 2014 |publisher=LLVM Project |access-date=3 March 2015 |archive-date=3 August 2020 |archive-url=https://web.archive.org/web/20200803053328/http://llvm.org/devmtg/2014-02/slides/moller-llvmlinux.pdf |url-status=live}}
In 2017, developers completed upstreaming patches to support building the Linux kernel with Clang in the 4.15 release, having backported support for X86-64 and AArch64 to the 4.4, 4.9, and 4.14 branches of the stable kernel tree. Google's Pixel 2 shipped with the first Clang built Linux kernel,{{cite web |url=https://www.youtube.com/watch?v=6l4DtR5exwo&t=2130 |title=2017 LLVM Developers' Meeting: Compiling Android userspace and Linux kernel with LLVM |date=18 October 2017 |publisher=YouTube |last1=Desaulniers |first1=Nick |last2=Hackmann |first2=Greg |last3=Hines |first3=Stephen |access-date=7 December 2020 |archive-date=31 December 2020 |archive-url=https://web.archive.org/web/20201231030548/https://www.youtube.com/watch?v=6l4DtR5exwo&t=2130 |url-status=live}} though patches for Pixel (1st generation) did exist.{{cite web |url=https://android-review.googlesource.com/q/topic:marlin-nougat-mr1-clang+(status:open+OR+status:closed) |access-date=6 December 2020 |last=Hackmann |first=Greg |title=marlin-nougat-mr1-clang Patch Series |date=2 February 2017 |archive-date=10 December 2020 |archive-url=https://web.archive.org/web/20201210125624/https://android-review.googlesource.com/q/topic:marlin-nougat-mr1-clang+(status:open+OR+status:closed) |url-status=live}} 2018 saw ChromeOS move to building kernels with Clang by default,{{cite web |url=https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1294370 |access-date=6 December 2020 |date=22 October 2018 |last=Kaehlcke |first=Matthias |title=cros-kernel2: Make clang the default compiler for kernel builds |archive-date=10 December 2020 |archive-url=https://web.archive.org/web/20201210015343/https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1294370 |url-status=live}} while Android made Clang{{cite web |url=https://www.phoronix.com/scan.php?page=news_item&px=Google-2019-Clang-Kernel |access-date=6 December 2020 |last=Larabel |first=Michael |author-link=Michael Larabel |publisher=Phoronix |title=Using LLVM Clang To Compile The Linux Kernel Is Heating Up Again Thanks To Google |date=4 February 2019 |archive-date=25 November 2020 |archive-url=https://web.archive.org/web/20201125201932/https://www.phoronix.com/scan.php?page=news_item&px=Google-2019-Clang-Kernel |url-status=live}} and LLVM's linker LLD{{cite web |url=https://android-review.googlesource.com/c/platform/test/vts-testcase/kernel/+/1185200 |access-date=6 December 2020 |title=vts: kernel: enforce vts_kernel_toolchain for all TARGET_ARCH for R |last=Desaulniers |first=Nick |date=10 December 2019 |archive-date=10 December 2020 |archive-url=https://web.archive.org/web/20201210125711/https://android-review.googlesource.com/c/platform/test/vts-testcase/kernel/+/1185200 |url-status=live}} required for kernel builds in 2019. Google moved its production kernel used throughout its datacenters to being built with Clang in 2020.{{cite web |url=https://lore.kernel.org/lkml/CAKwvOdmKjsJGbR7hHACk3qUgguy-HWvJQerwTnArE0AwhPgfcQ@mail.gmail.com/ |access-date=6 December 2020 |last=Desaulniers |first=Nick |title=Re: violating function pointer signature |date=19 November 2020 |publisher=LKML}} Today, the [https://clangbuiltlinux.github.io/ ClangBuiltLinux] group coordinates fixes to both Linux and LLVM to ensure compatibility, both composed of members from LLVMLinux and having upstreamed patches from LLVMLinux.
= Debugging =
{{Main|KGDB|Kernel panic|Linux kernel oops}}
As with any software, problems with the Linux kernel can be difficult to troubleshoot. Common challenges relate to userspace vs. kernel space access, misuse of synchronization primitives, and incorrect hardware management.{{Rp|page=364}}
An oops is a non-fatal error in the kernel. After such an error, operations continue with suspect reliability.{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0303.1/0009.html |title=Re: what's an OOPS |last=Bradford |first=John |date=8 March 2003 |mailing-list=LKML |access-date=30 October 2010 |archive-date=31 October 2014 |archive-url=https://web.archive.org/web/20141031032356/http://lkml.iu.edu/hypermail/linux/kernel/0303.1/0009.html |url-status=live}}
A panic (generated by {{Mono|panic()}}) is a fatal error. After such an error, the kernel prints a message and halts the computer.{{Rp|page=371}}
The kernel provides for debugging by printing via {{Mono|printk()}} which stores messages in a circular buffer (overwriting older entries with newer). The {{Mono|syslog(2)}} system call provides for reading and clearing the message buffer and for setting the maximum log level of the messages to be sent to the console.{{cite web|title=syslog(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/syslog.2.html|access-date=15 August 2020|website=man7.org|archive-date=13 October 2020|archive-url=https://web.archive.org/web/20201013152012/https://man7.org/linux/man-pages/man2/syslog.2.html|url-status=live}} Kernel messages are also exported to userland through the /dev/kmsg interface.{{cite web|title=kmsg: export printk records to the /dev/kmsg interface [LWN.net]|url=https://lwn.net/Articles/493182/|access-date=16 August 2020|website=lwn.net|archive-date=2 October 2015|archive-url=https://web.archive.org/web/20151002050933/http://lwn.net/Articles/493182/|url-status=live}}
The ftrace mechanism allow for debugging by tracing. It is used for monitoring and debugging Linux at runtime and it can analyze user space latencies due to kernel misbehavior.{{Citation|title=See what your computer is doing with Ftrace utilities| date=24 January 2019 |url=https://www.youtube.com/watch?v=68osT1soAPM |archive-url=https://ghostarchive.org/varchive/youtube/20211215/68osT1soAPM |archive-date=15 December 2021 |url-status=live|language=en|access-date=9 May 2021}}{{cbignore}}{{cite web|title=Debugging the kernel using Ftrace - part 1 [LWN.net]|url=https://lwn.net/Articles/365835/|access-date=15 September 2020|website=lwn.net|archive-date=9 November 2020|archive-url=https://web.archive.org/web/20201109001219/https://lwn.net/Articles/365835/|url-status=live}}{{cite web|title=Debugging the kernel using Ftrace - part 2 [LWN.net]|url=https://lwn.net/Articles/366796/|access-date=15 September 2020|website=lwn.net|archive-date=31 March 2020|archive-url=https://web.archive.org/web/20200331222229/https://lwn.net/Articles/366796/|url-status=live}}{{cite web|title=ftrace - Function Tracer — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/trace/ftrace.html|access-date=15 September 2020|website=Kernel.org|archive-date=19 September 2020|archive-url=https://web.archive.org/web/20200919095357/https://www.kernel.org/doc/html/latest/trace/ftrace.html|url-status=live}} Furthermore, ftrace allows users to trace Linux at boot-time.{{cite web|title=Boot-time tracing — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/trace/boottime-trace.html|access-date=19 September 2020|website=Kernel.org|archive-date=31 October 2020|archive-url=https://web.archive.org/web/20201031200922/https://www.kernel.org/doc/html/latest/trace/boottime-trace.html|url-status=live}}
kprobes and kretprobes can break into kernel execution (like debuggers in userspace) and collect information non-disruptively.{{cite web|title=Kernel Probes (Kprobes) — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/trace/kprobes.html|access-date=6 October 2020|website=Kernel.org|archive-date=11 October 2020|archive-url=https://web.archive.org/web/20201011030448/https://www.kernel.org/doc/html/latest/trace/kprobes.html|url-status=live}} kprobes can be inserted into code at (almost) any address, while kretprobes work at function return. uprobes have similar purposes but they also have some differences in usage and implementation.{{cite web|title=Uprobe-tracer: Uprobe-based Event Tracing — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/trace/uprobetracer.html|access-date=6 October 2020|website=Kernel.org|archive-date=4 December 2020|archive-url=https://web.archive.org/web/20201204204113/https://www.kernel.org/doc/html/latest/trace/uprobetracer.html|url-status=live}}
With KGDB Linux can be debugged in much the same way as userspace programs. KGDB requires an additional machine that runs GDB and that is connected to the target to be debugged using a serial cable or Ethernet.{{cite web|title=Using kgdb, kdb and the kernel debugger internals|url=https://mirrors.edge.kernel.org/pub/linux/kernel/people/jwessel/kdb/index.html|access-date=3 November 2020|website=mirrors.edge.kernel.org|archive-date=26 January 2021|archive-url=https://web.archive.org/web/20210126003430/https://mirrors.edge.kernel.org/pub/linux/kernel/people/jwessel/kdb/index.html|url-status=live}}
= Change process =
The Linux kernel project integrates new code on a rolling basis. Standard operating procedure is that software checked into the project must work and compile without error.
Each kernel subsystem is assigned a maintainer who is responsible for reviewing patches against the kernel code standards and keeping a queue of patches that can be submitted to Torvalds within a merge window that is usually several weeks.
Patches are merged by Torvalds into the source code of the prior stable Linux kernel release, creating the release candidate (-rc) for the next stable release. Once the merge window is closed, only fixes to the new code in the development release are accepted. The -rc development release of the kernel goes through regression testing and once it is considered stable by Torvalds and the subsystem maintainers, a new version is released and the development process starts over again.{{cite book |title=Pro Linux Embedded Systems |author= Gene Sally|year=2010 |publisher=Apress |isbn=9781430272267 |page=252}}
=Mainline Linux=
{{Anchor|MAINLINE}}
The Git tree that contains the Linux kernel source code is referred to as mainline Linux. Every stable kernel release originates from the mainline tree,{{Cite book|last=Billimoria|first=Kaiwan N.|url=https://www.worldcat.org/oclc/1240585605|title=Linux Kernel Programming A Comprehensive Guide to Kernel Internals, Writing Kernel Modules, and Kernel Synchronization.|date=2021|publisher=Packt Publishing, Limited|isbn=978-1-78995-592-7|location=Birmingham|page=55|oclc=1240585605}} and is frequently published on kernel.org. Mainline Linux has only solid support for a small subset of the many devices that run Linux. Non-mainline support is provided by independent projects, such as Yocto or Linaro, but in many cases the kernel from the device vendor is needed.{{Cite book|last1=Vaduva|first1=Alexandru|last2=Gonzalez|first2=Alex|last3=Simmonds|first3=Chris |url=https://www.worldcat.org/oclc/960471438|title=Linux : embedded development : leverage the power of Linux to develop captivating and powerful embedded Linux projects : a course in three modules|date=2016|publisher=Packt Publishing|isbn=978-1-78712-445-5|location=Birmingham, UK|page=663|oclc=960471438}} Using a vendor kernel likely requires a board support package.
Maintaining a kernel tree outside of mainline Linux has proven to be difficult.{{Cite book|url=https://www.worldcat.org/oclc/273049576|title=Building embedded Linux systems|date=2008|publisher=O'Reilly Media|author=Karim Yaghmour|isbn=978-0-596-52968-0|edition=2nd|location=Sebastopol [Calif.]|page=387|oclc=273049576}}
Mainlining refers to the effort of adding support for a device to the mainline kernel,{{Cite book|last=Yaghmour|first=Karim|url=https://www.worldcat.org/oclc/812180000|title=Embedded Android|date=2011|publisher=O'Reilly Media|isbn=978-1-4493-2798-9|location=Sebastopol, CA|page=44|oclc=812180000}} while there was formerly only support in a fork or no support at all. This usually includes adding drivers or device tree files. When this is finished, the feature or security fix is considered mainlined.{{cite web |date=6 November 2014 |title=SoC (System on a Chip) |url=https://openwrt.org/docs/techref/hardware/soc |url-status=live |archive-url=https://web.archive.org/web/20220823021323/https://openwrt.org/docs/techref/hardware/soc |archive-date=23 August 2022 |access-date=15 March 2021 |website=OpenWrt Wiki |language=en}}
=Linux-like kernel=
The maintainer of the stable branch, Greg Kroah-Hartman, has applied the term Linux-like to downstream kernel forks by vendors that add millions of lines of code to the mainline kernel.{{cite web|title=What to do about CVE numbers [LWN.net]|url=https://lwn.net/Articles/801157/|access-date=15 March 2021|website=lwn.net}} In 2019, Google stated that it wanted to use the mainline Linux kernel in Android so the number of kernel forks would be reduced.{{cite web|last=Amadeo|first=Ron|date=20 November 2019|title=Google outlines plans for mainline Linux kernel support in Android|url=https://arstechnica.com/gadgets/2019/11/google-outlines-plans-for-mainline-linux-kernel-support-in-android/|access-date=31 March 2021|website=Ars Technica|language=en-us}} The term Linux-like has also been applied to the Embeddable Linux Kernel Subset, which does not include the full mainline Linux kernel but a small modified subset of the code.{{Citation|last=Bruchon|first=Jody|title=jbruchon/elks|date=24 April 2021|url=https://github.com/jbruchon/elks|access-date=27 April 2021}}
= Linux forks =
File:Ipod linux booting kernel.jpg booting iPodLinux ]]
There are certain communities that develop kernels based on the official Linux. Some interesting bits of code from these forks that include Linux-libre, Compute Node Linux, INK, L4Linux, RTLinux, and User-Mode Linux (UML) have been merged into the mainline.{{cite web| url = https://linuxplumbersconf.org/ocw/proposals/49| title = The state of preempt-rt| access-date = 14 June 2016| website = linuxplumbersconf.org| archive-url = https://web.archive.org/web/20161015044835/https://linuxplumbersconf.org/ocw/proposals/49| archive-date = 15 October 2016| url-status = dead| df = dmy-all}} Some operating systems developed for mobile phones initially used heavily modified versions of Linux, including Google Android, Firefox OS, HP webOS, Nokia Maemo and Jolla Sailfish OS. In 2010, the Linux community criticised Google for effectively starting its own kernel tree:{{cite web |url=https://www.zdnet.com/article/linux-developer-explains-android-kernel-code-removal/ |title=Linux developer explains Android kernel code removal |last=Meyer |first=David |date=3 February 2010 |work=ZDNet |publisher=CBS Interactive |access-date=3 February 2010 |archive-date=15 October 2016 |archive-url=https://web.archive.org/web/20161015045139/http://www.zdnet.com/article/linux-developer-explains-android-kernel-code-removal/ |url-status=live}}{{cite book|date=2008 |title=maemo Technology Overview |chapter-url=http://maemo.org/maemo_training_material/maemo4.x/html/maemo_Technology_Overview/Chapter_03_maemo_Platform_Overview.html |publisher=Nokia |chapter=Chapter 03: maemo Platform Overview |access-date=9 April 2010 |archive-url=https://web.archive.org/web/20080616191310/http://maemo.org/maemo_training_material/maemo4.x/html/maemo_Technology_Overview/Chapter_03_maemo_Platform_Overview.html |archive-date=16 June 2008 |url-status=dead}}
{{Blockquote|text=This means that any drivers written for Android hardware platforms, can not get merged into the main kernel tree because they have dependencies on code that only lives in Google's kernel tree, causing it to fail to build in the kernel.org tree. Because of this, Google has now prevented a large chunk of hardware drivers and platform code from ever getting merged into the main kernel tree. Effectively creating a kernel branch that a number of different vendors are now relying on.{{cite web |url=http://www.kroah.com/log/linux/android-kernel-problems.html |title=Android and the Linux kernel community |last=Kroah-Hartman |first=Greg |date=2 February 2010 |access-date=3 February 2010 |archive-date=27 April 2019 |archive-url=https://web.archive.org/web/20190427144039/http://www.kroah.com/log/linux/android-kernel-problems.html |url-status=live}} |sign=Greg Kroah-Hartman, 2010}}
Today Android uses a customized Linux{{cite book |title=Android System Programming |author=Roger Ye|year=2017 |publisher=Packt Publishing |isbn=9781787120389 |page=14}} where major changes are implemented in device drivers, but some changes to the core kernel code is required. Android developers also submit patches to the official Linux that finally can boot the Android operating system. For example, a Nexus 7 can boot and run the mainline Linux.
At a 2001 presentation at the Computer History Museum, Torvalds had this to say in response to a question about distributions of Linux using precisely the same kernel sources or not:
{{Blockquote |text=They're not... well they are, and they're not. There is no single kernel. Every single distribution has their own changes. That's been going on since pretty much day one. I don't know if you may remember Yggdrasil was known for having quite extreme changes to the kernel and even today all of the major vendors have their own tweaks because they have some portion of the market they're interested in and quite frankly that's how it should be. Because if everybody expects one person, me, to be able to track everything that's not the point of GPL. That's not the point of having an open system. So actually the fact that a distribution decides that something is so important to them that they will add patches for even when it's not in the standard kernel, that's a really good sign for me. So that's for example how something like ReiserFS got added. And the reason why ReiserFS is the first journaling filesystem that was integrated in the standard kernel was not because I love Hans Reiser. It was because SUSE actually started shipping with ReiserFS as their standard kernel, which told me "ok." This is actually in production use. Normal People are doing this. They must know something I don't know. So in a very real sense what a lot of distribution houses do, they are part of this "let's make our own branch" and "let's make our changes to this." And because of the GPL, I can take the best portions of them.{{cite web |url=https://www.youtube.com/watch?v=WVTWCPoUt8w&t=3435 |archive-url=https://ghostarchive.org/varchive/youtube/20211215/WVTWCPoUt8w |archive-date=2021-12-15 |url-status=live|publisher=YouTube |date=19 September 2001 |last=Torvalds |first=Linus |access-date=6 December 2020 |title=The Origins of Linux—Linus Torvalds}}{{cbignore}} |sign=Linus Torvalds, 2001}}
=Long-term support=
The latest version and older versions are maintained separately. Most of the latest kernel releases were supervised by Torvalds.{{cite web |url=https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=MAINTAINERS |archive-url=https://archive.today/20130112231112/http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=MAINTAINERS |url-status=dead |archive-date=12 January 2013 |title=Linux MAINTAINERS file}}
The Linux kernel developer community maintains a stable kernel by applying fixes for software bugs that have been discovered during the development of the subsequent stable kernel. Therefore, www.kernel.org always lists two stable kernels. The next stable Linux kernel is released about 8 to 12 weeks later.
Some releases are designated for long-term support as longterm with bug fix releases for two or more years.{{cite book |title=Linux: Embedded Development |author= Alexandru Vaduva, Alex Gonzalez & Chris Simmonds|year=2016 |publisher=Packt Publishing|isbn=9781787124455 |page=663}}
= Size =
Some projects have attempted to reduce the size of the Linux kernel. One of them is TinyLinux. In 2014, Josh Triplett started the -tiny source tree for a reduced size version.{{Cite web |title=Linux for little systems [LWN.net] |url=https://lwn.net/Articles/63516/ |access-date=2024-11-22 |website=lwn.net}}{{Cite web |title=Kernel tinification [LWN.net] |url=https://lwn.net/Articles/608945/ |access-date=2024-11-22 |website=lwn.net}}{{Cite web |last=Brown |first=Eric |date=2017-04-13 |title=Shrinking the Linux Kernel and File System for IoT |url=https://www.linux.com/news/shrinking-linux-kernel-and-file-system-iot/ |access-date=2024-11-22 |website=Linux.com |language=en-US}}{{Cite book |last1=Shizukuishi |first1=Takuya |last2=Matsubara |first2=Katsuya |chapter=An efficient tinification of the linux kernel for minimizing resource consumption |date=2020-03-30 |title=Proceedings of the 35th Annual ACM Symposium on Applied Computing |chapter-url=https://dl.acm.org/doi/10.1145/3341105.3373913 |language=en |publisher= |pages=1228–1237 |doi=10.1145/3341105.3373913 |isbn=978-1-4503-6866-7}}
Architecture and features
{{See also|vmlinux}}
File:Sankey Diagram of Linux Kernel Source Lines of Code.jpg of Linux Kernel Source Lines of Code]]
Even though seemingly contradictory, the Linux kernel is both monolithic and modular. The kernel is classified as a monolithic kernel architecturally since the entire OS runs in kernel space. The design is modular since it can be assembled from modules that in some cases are loaded and unloaded at runtime.{{rp|page=338}}{{cite web|title=README|url=https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=README;h=90a07658ede14840346eee6610648bcf4ec79997;hb=f3b8436ad9a8ad36b3c9fa1fe030c7f38e5d3d0b|url-status=dead|archive-url=https://archive.today/20120724163945/http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=README;h=90a07658ede14840346eee6610648bcf4ec79997;hb=f3b8436ad9a8ad36b3c9fa1fe030c7f38e5d3d0b|archive-date=24 July 2012|access-date=24 March 2021|publisher=git.kernel.org}} It supports features once only available in closed source kernels of non-free operating systems.
The rest of the article makes use of the UNIX and Unix-like operating systems convention of the manual pages. The number that follows the name of a command, interface, or other feature specifies the section (i.e. the type of the OS' component or feature) it belongs to. For example {{mono|execve(2)}} refers to a system call, and {{mono|exec(3)}} refers to a userspace library wrapper.
The following is an overview of architectural design and of noteworthy features.
- Concurrent computing and (with the availability of enough CPU cores for tasks that are ready to run) even true parallel execution of many processes at once (each of them having one or more threads of execution) on SMP and NUMA architectures.
- Selection and configuration of hundreds of kernel features and drivers (using one of the {{Mono|make *config}} family of commands before building),{{cite web|title=KernelBuild - Linux Kernel Newbies|url=https://kernelnewbies.org/KernelBuild|access-date=13 September 2020|website=kernelnewbies.org|archive-date=19 October 2020|archive-url=https://web.archive.org/web/20201019124650/https://kernelnewbies.org/KernelBuild|url-status=live}} modification of kernel parameters before boot (usually by inserting instructions into the lines of the GRUB2 menu), and fine tuning of kernel behavior at run-time (using the {{mono|sysctl(8)}} interface to {{Mono|/proc/sys/}}).{{cite web|title=The Sysctl Interface|url=https://www.linux.it/~rubini/docs/sysctl/sysctl.html|access-date=13 September 2020|website=Linux.it|archive-date=17 February 2020|archive-url=https://web.archive.org/web/20200217004812/http://www.linux.it/~rubini/docs/sysctl/sysctl.html|url-status=live}}{{cite web|title=sysctl(8) - Linux manual page|url=https://man7.org/linux/man-pages/man8/sysctl.8.html|access-date=13 September 2020|website=man7.org|archive-date=30 September 2020|archive-url=https://web.archive.org/web/20200930200903/https://man7.org/linux/man-pages/man8/sysctl.8.html|url-status=live}}{{cite web|title=procfs(5) - Linux manual page|url=https://man7.org/linux/man-pages/man5/procfs.5.html|access-date=13 September 2020|website=man7.org|archive-date=24 September 2020|archive-url=https://web.archive.org/web/20200924010905/https://man7.org/linux/man-pages/man5/procfs.5.html|url-status=live}}
- Configuration (again using the {{Mono|make *config}} commands) and run-time modifications of the policies{{cite web|title=sched(7) - Linux manual page|url=https://man7.org/linux/man-pages/man7/sched.7.html|access-date=27 July 2020|website=man7.org|archive-date=17 July 2020|archive-url=https://web.archive.org/web/20200717155549/https://man7.org/linux/man-pages/man7/sched.7.html|url-status=live}} (via {{Mono|nice(2)}}, {{Mono|setpriority(2)}}, and the family of {{Mono|sched_*(2)}} syscalls) of the task schedulers that allow preemptive multitasking (both in user mode and, since the 2.6 series, in kernel mode{{cite web | url = http://kernelnewbies.org/FAQ/Preemption | title = FAQ: Preemption | date = 22 August 2009 | access-date = 7 May 2015 | website = kernelnewbies.org | archive-date = 7 August 2020 | archive-url = https://web.archive.org/web/20200807081640/https://kernelnewbies.org/FAQ/Preemption | url-status = live}}{{cite web | url = https://lwn.net/Articles/22912/ | title = Driver porting: the preemptible kernel | date = 24 February 2003 | access-date = 7 May 2015 | author = Jonathan Corbet | publisher = LWN.net | archive-date = 10 August 2020 | archive-url = https://web.archive.org/web/20200810170137/https://lwn.net/Articles/22912/ | url-status = live}}); the earliest eligible virtual deadline first scheduling (EEVDF) scheduler,{{Cite web|url=https://www.phoronix.com/news/Linux-6.6-EEVDF-Merged|title=EEVDF Scheduler Merged For Linux 6.6, Intel Hybrid Cluster Scheduling Re-Introduced|website=Phoronix}} is the default scheduler of Linux since 2023 and it uses a red-black tree which can search, insert and delete process information (task struct) with O(log n) time complexity, where n is the number of runnable tasks.{{cite web|url=https://www.linuxjournal.com/node/10267|title=Completely Fair Scheduler {{!}} Linux Journal|website=Linuxjournal.com|access-date=30 March 2020|archive-date=3 August 2020|archive-url=https://web.archive.org/web/20200803104512/https://www.linuxjournal.com/node/10267|url-status=live}}
- Advanced memory management with paged virtual memory.
- Inter-process communications and synchronization mechanism.
- A virtual filesystem on top of several concrete filesystems (ext4, Btrfs, XFS, JFS, FAT32, and many more).
- Configurable I/O schedulers, {{Mono|ioctl(2)}}{{cite web|title=ioctl(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/ioctl.2.html|access-date=11 August 2020|website=man7.org|archive-date=20 July 2020|archive-url=https://web.archive.org/web/20200720073257/https://man7.org/linux/man-pages/man2/ioctl.2.html|url-status=live}} syscall that manipulates the underlying device parameters of special files (it is a non standard system call, since arguments, returns, and semantics depends on the device driver in question), support for POSIX asynchronous I/O{{cite web|title=aio(7) - Linux manual page|url=https://man7.org/linux/man-pages/man7/aio.7.html|access-date=11 August 2020|website=man7.org|archive-date=12 April 2020|archive-url=https://web.archive.org/web/20200412005208/http://man7.org/linux/man-pages/man7/aio.7.html|url-status=live}} (however, because they scale poorly with multithreaded applications, a family of Linux specific I/O system calls ({{Mono|io_*(2)}}{{cite web|title=io_setup(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/io_setup.2.html|access-date=11 August 2020|website=man7.org|archive-date=20 August 2020|archive-url=https://web.archive.org/web/20200820190947/https://man7.org/linux/man-pages/man2/io_setup.2.html|url-status=live}}) had to be created for the management of asynchronous I/O contexts suitable for concurrent processing).
- OS-level virtualization (with Linux-VServer), paravirtualization and hardware-assisted virtualization (with KVM or Xen, and using QEMU for hardware emulation);{{cite web|url=https://www.linux-kvm.org/page/Main_Page|title=KVM|website=Linux-kvm.org|access-date=29 March 2020|archive-date=28 March 2020|archive-url=https://web.archive.org/web/20200328192644/https://www.linux-kvm.org/page/Main_Page|url-status=live}}{{cite web|url=https://virt.kernelnewbies.org/TechComparison|title=TechComparison - Linux Virtualization Wiki|website=Virt.kernelnewbies.org|access-date=29 March 2020|archive-date=3 August 2020|archive-url=https://web.archive.org/web/20200803081859/https://virt.kernelnewbies.org/TechComparison|url-status=live}}{{cite web|url=https://kernelnewbies.org/Linux_2_6_20#Virtualization_support_through_KVM|title=Virtualization_support_through_KVM in Linux_2_6_20 - Linux Kernel Newbies|website=Kernelnewbies.org|access-date=29 March 2020|archive-date=29 November 2019|archive-url=https://web.archive.org/web/20191129072053/https://kernelnewbies.org/Linux_2_6_20#Virtualization_support_through_KVM|url-status=live}}{{cite web|url=https://blogs.oracle.com/wim/linux-mainline-contains-all-the-xen-code-bits-for-dom0-and-domu-support|title=Linux mainline contains all the Xen code bits for Dom0 and DomU support|last=Coekaerts|first=Wim|website=blogs.oracle.com|access-date=29 March 2020|archive-date=3 August 2020|archive-url=https://web.archive.org/web/20200803103832/https://blogs.oracle.com/wim/linux-mainline-contains-all-the-xen-code-bits-for-dom0-and-domu-support|url-status=live}}{{cite web|url=http://blog.xen.org/index.php/2011/06/02/xen-celebrates-full-dom0-and-domu-support-in-linux-3-0/|archive-url=https://web.archive.org/web/20110607003740/http://blog.xen.org/index.php/2011/06/02/xen-celebrates-full-dom0-and-domu-support-in-linux-3-0/|url-status=dead|archive-date=7 June 2011|title=Xen celebrates full Dom0 and DomU support in Linux 3.0 – blog.xen.org|date=7 June 2011|access-date=29 March 2020}}{{cite web|url=https://xenproject.org/2014/01/31/linux-3-14-and-pvh/|title=Linux 3.14 and PVH|last=Wilk|first=Konrad Rzeszutek|date=31 January 2014|website=Xen Project|language=en-US|access-date=29 March 2020|archive-date=29 March 2020|archive-url=https://web.archive.org/web/20200329115320/https://xenproject.org/2014/01/31/linux-3-14-and-pvh/|url-status=live}} On the Xen hypervisor, the Linux kernel provides support to build Linux distributions (such as openSUSE Leap and many others) that work as Dom0, that are virtual machine host servers that provide the management environment for the user's virtual machines (DomU).{{cite web|title=Introduction to Xen Virtualization {{!}} Virtualization Guide {{!}} openSUSE Leap 15.2|url=https://doc.opensuse.org/documentation/leap/virtualization/html/book.virt/cha-xen-basics.html|access-date=29 September 2020|website=doc.opensuse.org|archive-date=28 September 2020|archive-url=https://web.archive.org/web/20200928214033/https://doc.opensuse.org/documentation/leap/virtualization/html/book.virt/cha-xen-basics.html|url-status=live}}
- I/O Virtualization with VFIO and SR-IOV. Virtual Function I/O (VFIO) exposes direct device access to user space in a secure memory (IOMMU) protected environment. With VFIO, a VM Guest can directly access hardware devices on the VM Host Server. This technique improves performance, if compared both to Full virtualization and Paravirtualization. However, with VFIO, devices cannot be shared with multiple VM guests. Single Root I/O Virtualization (SR-IOV) combines the performance gains of VFIO and the ability to share a device with several VM Guests (but it requires special hardware that must be capable to appear to two or more VM guests as different devices).{{cite web|title=Virtualization technology {{!}} Virtualization Guide {{!}} openSUSE Leap 15.3|url=https://doc.opensuse.org/documentation/leap/virtualization/html/book-virtualization/chap-virtualization-introduction.html#sec-vt-io|access-date=30 September 2021|website=doc.opensuse.org}}
- Security mechanisms for discretionary and mandatory access control (SELinux, AppArmor, POSIX ACLs, and others).
- Several types of layered communication protocols (including the Internet protocol suite).
- Asymmetric multiprocessing via the RPMsg subsystem.
Most device drivers and kernel extensions run in kernel space (ring 0 in many CPU architectures), with full access to the hardware. Some exceptions run in user space; notable examples are filesystems based on FUSE/CUSE, and parts of UIO.{{cite web | url = https://lwn.net/Articles/308445/ | title = Character devices in user space | date = 25 November 2008 | access-date = 7 May 2015 | author = Jake Edge | publisher = LWN.net | archive-date = 26 January 2021 | archive-url = https://web.archive.org/web/20210126131908/https://lwn.net/Articles/308445/ | url-status = live}}{{cite web | url = https://lwn.net/Articles/232575/ | title = UIO: user-space drivers | date = 2 May 2007 | access-date = 7 May 2015 | author = Jonathan Corbet | publisher = LWN.net | archive-date = 11 November 2020 | archive-url = https://web.archive.org/web/20201111193009/https://lwn.net/Articles/232575/ | url-status = live}} Furthermore, the X Window System and Wayland, the windowing system and display server protocols that most people use with Linux, do not run within the kernel. Differently, the actual interfacing with GPUs of graphics cards is an in-kernel subsystem called Direct Rendering Manager (DRM).
Unlike standard monolithic kernels, device drivers are easily configured as modules, and loaded or unloaded while the system is running and can also be pre-empted under certain conditions in order to handle hardware interrupts correctly and to better support symmetric multiprocessing. By choice, Linux has no stable device driver application binary interface.{{cite web|title=stable-api-nonsense - Linux kernel source tree|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-api-nonsense.rst|access-date=18 April 2020|website=git.kernel.org|archive-date=5 March 2021|archive-url=https://web.archive.org/web/20210305010734/https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-api-nonsense.rst|url-status=live}}
Linux typically makes use of memory protection and virtual memory and can also handle non-uniform memory access,{{cite book |last=Gorman |first=Mel |date=15 February 2004 |title=Understanding the Linux Virtual Memory Manager |url=https://pdos.csail.mit.edu/~sbw/links/gorman_book.pdf |publisher=Prentice Hall |page=26 |isbn=0-13-145348-3 |access-date=27 January 2020 |archive-date=3 May 2019 |archive-url=https://web.archive.org/web/20190503113248/https://pdos.csail.mit.edu/~sbw/links/gorman_book.pdf |url-status=live}} however the project has absorbed μClinux which also makes it possible to run Linux on microcontrollers without virtual memory.{{cite web|url=http://www.ucdot.org/article.pl?sid=02/11/05/0324207|title=uClinux mainline Announcement|access-date=15 January 2008|author=Greg Ungerer|archive-url=https://web.archive.org/web/20071031135123/http://www.ucdot.org/article.pl?sid=02%2F11%2F05%2F0324207|archive-date=31 October 2007|url-status=dead}}
The hardware is represented in the file hierarchy. User applications interact with device drivers via entries in the {{Mono|/dev}} or {{Mono|/sys}} directories.{{cite web |url=http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/index.html |title=Linux Filesystem Hierarchy: Chapter 1. Linux Filesystem Hierarchy |last=Nguyen |first=Binh |date=30 July 2004 |publisher=The Linux Documentation Project |access-date=28 November 2012 |archive-date=2 December 2020 |archive-url=https://web.archive.org/web/20201202064950/https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/index.html |url-status=live}} Process information is mapped into the {{Mono|/proc}} directory.
{{Linux layers}}
= Interfaces =
{{Main|Linux kernel interfaces|:Category:Interfaces of the Linux kernel|l2=Interfaces of the Linux kernel (Category)}}
{{See also|System call|POSIX|Single UNIX Specification}}
File:Linux kernel interfaces.svg
Linux started as a clone of UNIX, and aims toward POSIX and Single UNIX Specification compliance.{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/README.html|title=Linux kernel release 5.x — The Linux Kernel documentation|website=Kernel.org|access-date=4 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065108/https://www.kernel.org/doc/html/latest/admin-guide/README.html|url-status=live}} The kernel provides system calls and other interfaces that are Linux-specific. In order to be included in the official kernel, the code must comply with a set of licensing rules.{{cite web|title=COPYING|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/COPYING|url-status=live|archive-url=https://web.archive.org/web/20210902152553/https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/COPYING|archive-date=2 September 2021|access-date=2 September 2021|website=git.kernel.org}}
The Linux application binary interface (ABI) between the kernel and the user space has four degrees of stability (stable, testing, obsolete, removed);{{cite web|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/README|title=README\ABI\Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree|website=git.kernel.org|access-date=18 April 2020|archive-date=1 October 2020|archive-url=https://web.archive.org/web/20201001172809/https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/README|url-status=live}} The system calls are expected to never change in order to preserve compatibility for userspace programs that rely on them.{{cite web|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/stable/syscalls|title=syscalls\stable\ABI\Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree|website=git.kernel.org|access-date=18 April 2020|archive-date=2 October 2020|archive-url=https://web.archive.org/web/20201002061451/https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/stable/syscalls|url-status=live}}
Loadable kernel modules (LKMs), by design, cannot rely on a stable ABI. Therefore, they must always be recompiled whenever a new kernel executable is installed in a system, otherwise they will not be loaded. In-tree drivers that are configured to become an integral part of the kernel executable (vmlinux) are statically linked by the build process.
There is no guarantee of stability of source-level in-kernel API and, because of this, device driver code, as well as the code of any other kernel subsystem, must be kept updated with kernel evolution. Any developer who makes an API change is required to fix any code that breaks as the result of their change.{{cite web|title=1.Intro.rst - Documentation/process/1.Intro.rst - Linux source code (v5.8) - Bootlin|url=https://elixir.bootlin.com/linux/latest/source/Documentation/process/1.Intro.rst|access-date=8 August 2020|website=elixir.bootlin.com}}
== Kernel-to-userspace API ==
The set of the Linux kernel API that regards the interfaces exposed to user applications is fundamentally composed of UNIX and Linux-specific system calls.{{cite web|title=syscalls|url=http://man7.org/linux/man-pages/man2/syscalls.2.html|website=man7|access-date=28 January 2020|archive-date=15 January 2020|archive-url=https://web.archive.org/web/20200115033131/http://man7.org/linux/man-pages/man2/syscalls.2.html|url-status=live}} A system call is an entry point into the Linux kernel.{{cite web|title=intro(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/intro.2.html|access-date=16 July 2020|website=man7.org|archive-date=17 July 2020|archive-url=https://web.archive.org/web/20200717161934/https://man7.org/linux/man-pages/man2/intro.2.html|url-status=live}} For example, among the Linux-specific ones there is the family of the {{Mono|clone(2)}} system calls.{{cite web|url=http://man7.org/linux/man-pages/man2/clone.2.html|title=clone|website=man7.org|access-date=28 January 2020|archive-date=18 January 2020|archive-url=https://web.archive.org/web/20200118015900/http://man7.org/linux/man-pages/man2/clone.2.html|url-status=live}} Most extensions must be enabled by defining the _GNU_SOURCE
macro in a header file or when the user-land code is being compiled.{{cite web|url=http://man7.org/linux/man-pages/man7/feature_test_macros.7.html|title=feature_test_macros|website=man7.org|access-date=28 January 2020|archive-date=19 January 2020|archive-url=https://web.archive.org/web/20200119174511/http://man7.org/linux/man-pages/man7/feature_test_macros.7.html|url-status=live}}
System calls can only be invoked via assembly instructions that enable the transition from unprivileged user space to privileged kernel space in ring 0. For this reason, the C standard library (libC) acts as a wrapper to most Linux system calls, by exposing C functions that, if needed,{{cite web|url=http://man7.org/linux/man-pages/man7/vdso.7.html|title=vdso(7) - Linux manual page|website=man7.org|access-date=2 February 2020|archive-date=2 February 2020|archive-url=https://web.archive.org/web/20200202123949/http://man7.org/linux/man-pages/man7/vdso.7.html|url-status=live}} transparently enter the kernel which will execute on behalf of the calling process. For system calls not exposed by libC, such as the fast userspace mutex,{{cite web|url=http://man7.org/linux/man-pages/man2/futex.2.html|title=futex(2) - Linux manual page|website=man7.org|access-date=2 February 2020|archive-date=31 January 2020|archive-url=https://web.archive.org/web/20200131144454/http://man7.org/linux/man-pages/man2/futex.2.html|url-status=live}} the library provides a function called {{Mono|syscall(2)}} which can be used to explicitly invoke them.{{cite web|url=http://man7.org/linux/man-pages/man2/syscall.2.html|title=syscall(2) - Linux manual page|website=man7.org|access-date=2 February 2020|archive-date=21 January 2020|archive-url=https://web.archive.org/web/20200121174524/http://man7.org/linux/man-pages/man2/syscall.2.html|url-status=live}}
Pseudo filesystems (e.g., the sysfs and procfs filesystems) and special files (e.g., /dev/random
, /dev/sda
, /dev/tty
, and many others) constitute another layer of interface to kernel data structures representing hardware or logical (software) devices.{{cite web|url=http://man7.org/linux/man-pages/man5/sysfs.5.html|title=sysfs(5) - Linux manual page|website=man7.org|access-date=6 January 2020|archive-date=18 January 2020|archive-url=https://web.archive.org/web/20200118044323/http://man7.org/linux/man-pages/man5/sysfs.5.html|url-status=live}}{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/sysfs-rules.html|title=Rules on how to access information in sysfs — The Linux Kernel documentation|website=Kernel.org|access-date=6 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065123/https://www.kernel.org/doc/html/latest/admin-guide/sysfs-rules.html|url-status=live}}
== Kernel-to-userspace ABI ==
{{Main|Linux Standard Base}}Because of the differences existing between the hundreds of various implementations of the Linux OS, executable objects, even though they are compiled, assembled, and linked for running on a specific hardware architecture (that is, they use the ISA of the target hardware), often cannot run on different Linux distributions. This issue is mainly due to distribution-specific configurations and a set of patches applied to the code of the Linux kernel, differences in system libraries, services (daemons), filesystem hierarchies, and environment variables.
The main standard concerning application and binary compatibility of Linux distributions is the Linux Standard Base (LSB).{{cite web|url=https://refspecs.linuxbase.org/|title=Linux Foundation Referenced Specifications|website=refspecs.linuxbase.org|access-date=3 February 2020}}{{cite web|url=https://refspecs.linuxbase.org/lsb.shtml|title=LSB Specifications|website=refspecs.linuxbase.org|access-date=3 February 2020}} However, the LSB goes beyond what concerns the Linux kernel, because it also defines the desktop specifications, the X libraries and Qt that have little to do with it.{{cite web|url=https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Desktop-generic/LSB-Desktop-generic/book1.html|title=Linux Standard Base Desktop Specification, Generic Part|website=refspecs.linuxbase.org|access-date=3 February 2020}} The LSB version 5 is built upon several standards and drafts (POSIX, SUS, X/Open, File System Hierarchy (FHS), and others).{{cite web|url=https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/normativerefs.html|title=Normative References|website=refspecs.linuxfoundation.org|access-date=3 February 2020|archive-date=12 August 2020|archive-url=https://web.archive.org/web/20200812044159/https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/normativerefs.html|url-status=live}}
The parts of the LSB more relevant to the kernel are the General ABI (gABI),{{cite web|url=https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/book1.html|title=Linux Standard Base Core Specification, Generic Part|website=refspecs.linuxfoundation.org|access-date=3 February 2020|archive-date=29 November 2019|archive-url=https://web.archive.org/web/20191129194815/https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/book1.html|url-status=live}} especially the System V ABI{{cite web|url=https://www.sco.com/developers/devspecs/gabi41.pdf|title=System V Application Binary Interface - Edition 4.1|website=Sco.com|access-date=3 February 2020|archive-date=13 December 2019|archive-url=https://web.archive.org/web/20191213124815/http://www.sco.com/developers/devspecs/gabi41.pdf|url-status=live}}{{cite web|url=http://www.sco.com/developers/gabi/2003-12-17/contents.html|title=Xinuos Inc. {{!}} Developers {{!}} Gabi {{!}} 17 December 2003 {{!}} System V Application Binary Interface - DRAFT|website=Sco.com|access-date=3 February 2020|archive-date=3 February 2020|archive-url=https://web.archive.org/web/20200203124116/http://www.sco.com/developers/gabi/2003-12-17/contents.html|url-status=live}} and the Executable and Linking Format (ELF),{{cite web|url=https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/elf-generic.html|title=Executable And Linking Format (ELF)|website=Refspecs.linuxbase.org|access-date=3 February 2020}}{{cite web|title=elf(5) - Linux manual page|url=https://man7.org/linux/man-pages/man5/elf.5.html|access-date=18 November 2020|website=man7.org|archive-date=30 November 2020|archive-url=https://web.archive.org/web/20201130114725/https://man7.org/linux/man-pages/man5/elf.5.html|url-status=live}} and the Processor Specific ABI (psABI), for example the Core Specification for X86-64.{{cite web|url=https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-AMD64/LSB-Core-AMD64/book1.html|title=Linux Standard Base Core Specification for X86-64|website=Refspecs.linuxbase.org|access-date=3 February 2020}}{{cite web|url=https://refspecs.linuxbase.org/elf/gabi4+/contents.html|title=System V Application Binary Interface - DRAFT|website=Refspecs.linuxbase.org|access-date=3 February 2020}}
The standard ABI for how x86_64 user programs invoke system calls is to load the syscall number into the rax register, and the other parameters into rdi, rsi, rdx, r10, r8, and r9, and finally to put the syscall assembly instruction in the code.{{Cite book|last=Seyfarth|first=Ray|title=Introduction to 64 Bit Intel Assembly Language Programming for Linux|year=2012|isbn=9781478119203|page=170|publisher=CreateSpace Independent Publishing Platform }}{{cite web|title=Anatomy of a system call, part 1 [LWN.net]|url=https://lwn.net/Articles/604287/|access-date=16 July 2020|website=lwn.net|archive-date=18 August 2020|archive-url=https://web.archive.org/web/20200818051836/https://lwn.net/Articles/604287/|url-status=live}}{{cite web|title=Anatomy of a system call, part 2 [LWN.net]|url=https://lwn.net/Articles/604515/|access-date=16 July 2020|website=lwn.net|archive-date=6 August 2020|archive-url=https://web.archive.org/web/20200806081538/https://lwn.net/Articles/604515/|url-status=live}}
== In-kernel API ==
File:Linux AMD graphics stack.svg |access-date=21 January 2015 |archive-date=21 January 2015 |archive-url=https://web.archive.org/web/20150121163629/http://wiki.x.org/wiki/Events/XDC2014/XDC2014DeucherAMD/ |url-status=live}} The proprietary Linux graphic driver, {{Mono|libGL-fglrx-glx}}, will share the same DRM infrastructure with Mesa 3D. As there is no stable in-kernel ABI, AMD had to constantly adapt the former binary blob used by Catalyst.]]
There are several internal kernel APIs between kernel subsystems. Some are available only within the kernel subsystems, while a somewhat limited set of in-kernel symbols (i.e., variables, data structures, and functions) is exposed to dynamically loadable modules (e.g., device drivers loaded on demand) whether they're exported with the {{Mono|EXPORT_SYMBOL()}} and {{Mono|EXPORT_SYMBOL_GPL()}} macros{{cite web|url=https://www.kernel.org/doc/html/latest/kernel-hacking/hacking.html?highlight=export_symbol#symbols|title=Symbols - Unreliable Guide To Hacking The Linux Kernel — The Linux Kernel documentation|website=Kernel.org|access-date=8 February 2020|archive-date=3 August 2020|archive-url=https://web.archive.org/web/20200803074501/https://www.kernel.org/doc/html/latest/kernel-hacking/hacking.html?highlight=export_symbol#symbols|url-status=live}}{{cite web|url=https://lwn.net/Articles/249246/|title=Exported symbols and the internal API [LWN.net]|website=Lwn.net|access-date=15 March 2020|archive-date=31 March 2020|archive-url=https://web.archive.org/web/20200331211446/https://lwn.net/Articles/249246/|url-status=live}} (the latter reserved to modules released under a GPL-compatible license).{{cite web|url=https://lwn.net/Articles/813350/|title=Unexporting kallsyms_lookup_name() [LWN.net]|website=Lwn.net|access-date=15 March 2020|archive-date=1 April 2020|archive-url=https://web.archive.org/web/20200401062303/https://lwn.net/Articles/813350/|url-status=live}}
Linux provides in-kernel APIs that manipulate data structures (e.g., linked lists, radix trees,{{cite web|title=Trees I: Radix trees [LWN.net]|url=https://lwn.net/Articles/175432/|access-date=13 November 2020|website=lwn.net|archive-date=8 November 2020|archive-url=https://web.archive.org/web/20201108131647/https://lwn.net/Articles/175432/|url-status=live}} red-black trees,{{cite web|title=Trees II: red-black trees [LWN.net]|url=https://lwn.net/Articles/184495/|access-date=13 November 2020|website=lwn.net|archive-date=13 November 2020|archive-url=https://web.archive.org/web/20201113130357/https://lwn.net/Articles/184495/|url-status=live}} queues) or perform common routines (e.g., copy data from and to user space, allocate memory, print lines to the system log, and so on) that have remained stable at least since Linux version 2.6.{{cite web| url=https://www.kernel.org/doc/htmldocs/kernel-hacking/index.html| title=Unreliable Guide To Hacking The Linux Kernel| year=2005| website=Kernel.org| access-date=15 March 2020| edition=1st| archive-date=16 February 2020| archive-url=https://web.archive.org/web/20200216191225/https://www.kernel.org/doc/htmldocs/kernel-hacking/index.html| url-status=live}}{{cite web| url=https://www.kernel.org/doc/html/latest/kernel-hacking/hacking.html| title=Unreliable Guide To Hacking The Linux Kernel — The Linux Kernel documentation| website=Kernel.org| access-date=15 March 2020| archive-date=7 March 2020| archive-url=https://web.archive.org/web/20200307065323/https://www.kernel.org/doc/html/latest/kernel-hacking/hacking.html| url-status=live}}{{cite web| url=https://www.kernel.org/doc/html/latest/kernel-hacking/locking.html| title=Unreliable Guide To Locking — The Linux Kernel documentation| website=Kernel.org| access-date=15 March 2020| archive-date=7 March 2020| archive-url=https://web.archive.org/web/20200307065319/https://www.kernel.org/doc/html/latest/kernel-hacking/locking.html| url-status=live}}
In-kernel APIs include libraries of low-level common services used by device drivers:
- SCSI Interfaces and libATA{{snd}}respectively, a peer-to-peer packet based communication protocol for storage devices attached to USB, SATA, SAS, Fibre Channel, FireWire, ATAPI device,{{cite web|title=SCSI Interfaces Guide — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/driver-api/scsi.html|access-date=11 June 2020|website=Kernel.org|archive-date=2 June 2020|archive-url=https://web.archive.org/web/20200602154450/https://www.kernel.org/doc/html/latest/driver-api/scsi.html|url-status=live}} and an in-kernel library to support [S]ATA host controllers and devices.{{cite web|title=libATA Developer's Guide — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/driver-api/libata.html|access-date=11 June 2020|website=Kernel.org|archive-date=30 May 2020|archive-url=https://web.archive.org/web/20200530101401/https://www.kernel.org/doc/html/latest/driver-api/libata.html|url-status=live}}
- Direct Rendering Manager (DRM) and Kernel Mode Setting (KMS){{snd}}for interfacing with GPUs and supporting the needs of modern 3D-accelerated video hardware,{{cite web|title=DRM Internals — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/gpu/drm-internals.html|access-date=11 June 2020|website=Kernel.org|archive-date=1 June 2020|archive-url=https://web.archive.org/web/20200601202717/https://www.kernel.org/doc/html/latest/gpu/drm-internals.html|url-status=live}} and for setting screen resolution, color depth and refresh rate{{cite web|title=Kernel Mode Setting (KMS) — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#overview|access-date=11 June 2020|website=Kernel.org|archive-date=11 June 2020|archive-url=https://web.archive.org/web/20200611233817/https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#overview|url-status=live}}
- DMA buffers (DMA-BUF){{snd}}for sharing buffers for hardware direct memory access across multiple device drivers and subsystems{{cite web|title=Introduce DMA buffer sharing mechanism [LWN.net]|url=https://lwn.net/Articles/473668/|access-date=11 June 2020|website=lwn.net|archive-date=11 June 2020|archive-url=https://web.archive.org/web/20200611235759/https://lwn.net/Articles/473668/|url-status=live}}{{cite web|date=12 May 2016|title=Sharing CPU and GPU buffers on Linux*|url=https://01.org/blogs/2016/sharing-cpu-and-gpu-buffers-linux|access-date=11 June 2020|website=01.org|archive-date=11 June 2020|archive-url=https://web.archive.org/web/20200611231858/https://01.org/blogs/2016/sharing-cpu-and-gpu-buffers-linux|url-status=live}}{{cite web|title=Buffer Sharing and Synchronization — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/driver-api/dma-buf.html|access-date=11 June 2020|website=Kernel.org|archive-date=1 June 2020|archive-url=https://web.archive.org/web/20200601205610/https://www.kernel.org/doc/html/latest/driver-api/dma-buf.html|url-status=live}}
- Video4Linux{{snd}}for video capture hardware
- Advanced Linux Sound Architecture (ALSA){{snd}}for sound cards
- New API{{snd}}for network interface controllers
- mac80211 and cfg80211{{snd}}for wireless network interface controllers{{cite web |url=https://wireless.wiki.kernel.org/en/developers/Documentation/mac80211 |title=About mac80211 |publisher=Linux Kernel Organization, Inc. |access-date=8 June 2014 |archive-date=1 February 2021 |archive-url=https://web.archive.org/web/20210201114135/https://wireless.wiki.kernel.org/en/developers/documentation/mac80211 |url-status=live}}{{cite web|title=Linux 802.11 Driver Developer's Guide — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/driver-api/80211/index.html|access-date=19 November 2021|website=Kernel.org}}
== In-kernel ABI ==
= Process management =
{{See also|Process (computing)|Thread (computing)|Process management (computing)}}
Linux, as other kernels, has the ability to manage processes including creating, suspending, resuming and terminating. Unlike other operating systems, the Linux kernel implements processes as a group of threads called tasks. If two tasks share the same {{Mono | TGID}}, then they are called in the kernel terminology a task group. Each task is represented by a task_struct data structure. When a process is created it is assigned a globally unique identifier called PID and cannot be shared{{cite web|title=clone(2) - Linux manual page|url=https://man7.org/linux/man-pages/man2/clone.2.html|access-date=15 July 2020|website=man7.org|archive-date=15 July 2020|archive-url=https://web.archive.org/web/20200715175357/https://man7.org/linux/man-pages/man2/clone.2.html|url-status=live}}{{cite web|title=clone3(), fchmodat4(), and fsinfo() [LWN.net]|url=https://lwn.net/Articles/792628/|access-date=15 July 2020|website=lwn.net|archive-date=15 June 2020|archive-url=https://web.archive.org/web/20200615080341/https://lwn.net/Articles/792628/|url-status=live}}
A new process can be created by calling {{ Mono | clone}}{{cite web|title=[PATCH v3 1/2] fork: add clone3 [LWN.net]|url=https://lwn.net/ml/linux-kernel/20190604160944.4058-1-christian@brauner.io/|access-date=16 July 2020|website=lwn.net|archive-date=16 July 2020|archive-url=https://web.archive.org/web/20200716232314/https://lwn.net/ml/linux-kernel/20190604160944.4058-1-christian@brauner.io/|url-status=live}} family of system calls or {{Mono | fork}} system call. Processes can be suspended and resumed by the kernel by sending signals like {{Mono | SIGSTOP}} and {{Mono | SIGCONT}}. A process can terminate it's self by calling {{ Mono | exit}} system call, or terminated by another process by sending signals like {{ Mono | SIGKILL}},{{Mono | SIGABRT}} or {{Mono | SIGINT}}.
If the executable is dynamically linked to shared libraries, a dynamic linker is used to find and load the needed objects, prepare the program to run and then run it.{{cite web|title=ld-linux.so(8) - Linux manual page|url=https://man7.org/linux/man-pages/man8/ld-linux.so.8.html|access-date=18 November 2020|website=man7.org|archive-date=26 November 2020|archive-url=https://web.archive.org/web/20201126063027/https://man7.org/linux/man-pages/man8/ld-linux.so.8.html|url-status=live}}
The Native POSIX Thread Library (NPTL){{cite web|title=nptl(7) - Linux manual page|url=https://man7.org/linux/man-pages/man7/nptl.7.html|access-date=25 July 2020|website=man7.org|archive-date=25 July 2020|archive-url=https://web.archive.org/web/20200725045335/https://man7.org/linux/man-pages/man7/nptl.7.html|url-status=live}} provides the POSIX standard thread interface (pthreads) to userspace. The kernel isn't aware of processes nor threads but it is aware of tasks, thus threads are implemented in userspace. Threads in Linux are implemented as tasks sharing resources, while if they aren't sharing called to be independent processes.
The kernel provides the {{Mono|futex(7)}} (fast user-space mutex) mechanisms for user-space locking and synchronization.{{cite web|title=futex(7) - Linux manual page|url=https://man7.org/linux/man-pages/man7/futex.7.html|access-date=25 July 2020|website=man7.org|archive-date=15 July 2020|archive-url=https://web.archive.org/web/20200715175424/https://man7.org/linux/man-pages/man7/futex.7.html|url-status=live}} The majority of the operations are performed in userspace but it may be necessary to communicate with the kernel using the {{Mono|futex(2)}} system call.
As opposed to userspace threads described above, kernel threads run in kernel space.{{cite web|title=Kernel threads made easy [LWN.net]|url=https://lwn.net/Articles/65178/|access-date=15 August 2020|website=lwn.net|archive-date=31 March 2020|archive-url=https://web.archive.org/web/20200331215714/https://lwn.net/Articles/65178/|url-status=live}} They are threads created by the kernel it's self for specialized tasks, they are privileged like kernel and aren't bond to any process or application.
= Scheduling =
{{Main|Completely Fair Scheduler|Earliest eligible virtual deadline first scheduling}}
{{See also|Scheduling (computing)#Linux}}
The Linux process scheduler is modular, in the sense that it enables different scheduling classes and policies.{{cite web |last=Bar |first=Moshe |date=1 April 2000 |title=The Linux Scheduler |url=http://www.linuxjournal.com/article/3910 |url-status=live |archive-url=https://web.archive.org/web/20210202131440/https://www.linuxjournal.com/article/3910 |archive-date=2 February 2021 |access-date=14 April 2012 |work=Linux Journal |publisher=Belltown Media, Inc. |language=en}}{{Citation|title=BKK19-TR03 - The Linux Kernel Scheduler - Overview| date=23 April 2019 |url=https://www.youtube.com/watch?v=oOiaRHC9ZDg |archive-url=https://ghostarchive.org/varchive/youtube/20211215/oOiaRHC9ZDg |archive-date=15 December 2021 |url-status=live|language=en|access-date=17 May 2021}}{{cbignore}} Scheduler classes are plugable scheduler algorithms that can be registered with the base scheduler code. Each class schedules different types of processes. The core code of the scheduler iterates over each class in order of priority and chooses the highest priority scheduler that has a schedulable entity of type struct sched_entity ready to run.{{Rp|pages=46–47}} Entities may be threads, group of threads, and even all the processes of a specific user.
Linux provides both user preemption as well as full kernel preemption.{{Rp|pages=62–63}} Preemption reduces latency, increases responsiveness,{{cite web|title=Lowering Latency in Linux: Introducing a Preemptible Kernel {{!}} Linux Journal|url=https://www.linuxjournal.com/article/5600|access-date=17 August 2020|website=Linuxjournal.com|archive-date=9 August 2020|archive-url=https://web.archive.org/web/20200809182228/https://www.linuxjournal.com/article/5600|url-status=live}} and makes Linux more suitable for desktop and real-time applications.
For normal tasks, by default, the kernel uses the Completely Fair Scheduler (CFS) class, introduced in version 2.6.23.{{cite mailing list|title=[patch] Modular Scheduler Core and Completely Fair Scheduler [CFS]|url=https://lwn.net/Articles/230501/|last=Molnár|first=Ingo|author-link=Ingo Molnár|date=13 April 2007|mailing-list=LKML|access-date=30 March 2020|archive-date=3 November 2020|archive-url=https://web.archive.org/web/20201103034312/https://lwn.net/Articles/230501/|url-status=live}} The scheduler is defined as a macro in a C header as SCHED_NORMAL
. In other POSIX kernels, a similar policy known as SCHED_OTHER
allocates CPU timeslices (i.e, it assigns absolute slices of the processor time depending on either predetermined or dynamically computed priority of each process). The Linux CFS does away with absolute timeslices and assigns a fair proportion of CPU time, as a function of parameters like the total number of runnable processes and the time they have already run; this function also takes into account a kind of weight that depends on their relative priorities (nice values).{{Rp|pages=46–50}}
With user preemption, the kernel scheduler can replace the current process with the execution of a context switch to a different one that therefore acquires the computing resources for running (CPU, memory, and more). It makes it according to the CFS algorithm (in particular, it uses a variable called {{Mono|vruntime}} for sorting entities and then chooses the one that has the smaller vruntime, - i.e., the schedulable entity that has had the least share of CPU time), to the active scheduler policy and to the relative priorities.{{cite web|title=CFS Scheduler — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/latest/scheduler/sched-design-CFS.html#|access-date=1 May 2021|website=Kernel.org}} With kernel preemption, the kernel can preempt itself when an interrupt handler returns, when kernel tasks block, and whenever a subsystem explicitly calls the schedule() function.
The kernel also contains two POSIX-compliant{{cite web|url=http://www.opengroup.org/onlinepubs/009695399|title=IEEE Standard for Information Technology – Portable Operating System Interface, POSIX.1b, Real-time extensions (IEEE Std 1003.1b-1993)|access-date=17 March 2016|archive-date=16 November 2010|archive-url=https://web.archive.org/web/20101116144926/http://www.opengroup.org/onlinepubs/009695399/|url-status=live}} real-time scheduling classes named SCHED_FIFO
(realtime first-in-first-out) and SCHED_RR
(realtime round-robin), both of which take precedence over the default class. An additional scheduling policy known as SCHED DEADLINE
, implementing the earliest deadline first algorithm (EDF), was added in kernel version 3.14, released on 30 March 2014.{{cite web |url=https://www.phoronix.com/scan.php?page=news_item&px=MTU4Mjg |title=The Linux 3.14 Kernel Already Has Many Exciting Features |last=Larabel |first=Michael |author-link=Michael Larabel |date=24 January 2014 |publisher=Phoronix |access-date=3 February 2014 |archive-date=13 August 2020 |archive-url=https://web.archive.org/web/20200813143115/https://www.phoronix.com/scan.php?page=news_item&px=MTU4Mjg |url-status=live}}{{cite web |url=http://kernelnewbies.org/Linux_3.14#head-651929cdcf19cc2e2cfc7feb16b78ef963d195fe |title=Linux kernel 3.14, Section 1.1. Deadline scheduling class for better real-time scheduling |date=30 March 2014 |website=kernelnewbies.org |access-date=2 April 2014 |archive-date=15 January 2021 |archive-url=https://web.archive.org/web/20210115101454/https://kernelnewbies.org/Linux_3.14#head-651929cdcf19cc2e2cfc7feb16b78ef963d195fe |url-status=live}} SCHED_DEADLINE
takes precedence over all the other scheduling classes.
Real-time PREEMPT_RT
patches, included into the mainline Linux since version 2.6, provide a deterministic scheduler, the removal of preemption and interrupt disabling (where possible), PI Mutexes (i.e., locking primitives that avoid priority inversion),{{cite web|title=RT-mutex implementation design — The Linux Kernel documentation| url=https://www.kernel.org/doc/html/v5.15/locking/rt-mutex-design.html|access-date=17 December 2021|website=Kernel.org}}{{cite web|title=RT-mutex subsystem with PI support — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/v5.15/locking/rt-mutex.html|access-date=17 December 2021|website=Kernel.org}} support for High Precision Event Timers (HPET), preemptive read-copy-update (RCU), (forced) IRQ threads, and other minor features.{{cite web |url=https://lwn.net/Articles/146861/ |title=A realtime preemption overview |last=McKenney |first=Paul |date=10 August 2005 |publisher=LWN.net |access-date=5 February 2012 |archive-date=10 August 2020 |archive-url=https://web.archive.org/web/20200810165635/https://lwn.net/Articles/146861/ |url-status=live}}{{cite web |url=https://www.osadl.org/Realtime-Linux.projects-realtime-linux.0.html |title=OSADL Project: Realtime Linux |publisher=OSADL |access-date=5 February 2012 |archive-date=4 February 2021 |archive-url=https://web.archive.org/web/20210204170950/https://www.osadl.org/Realtime-Linux.projects-realtime-linux.0.html |url-status=live}}{{Cite web|url=https://events19.linuxfoundation.org/wp-content/uploads/2017/12/elc-eu-2018-rt-what-does-it-mean_Steven-Rostedt.pdf|title=Steven-Rostedt_on_PREEMPT_RT}}
In 2023, Peter Zijlstra proposed replacing CFS with an earliest eligible virtual deadline first scheduling (EEVDF) scheduler,{{Cite web |title=EEVDF Scheduler May Be Ready For Landing With Linux 6.6 |url=https://www.phoronix.com/news/Linux-6.6-EEVDF-Likely |access-date=31 August 2023 |website=Phoronix |language=en}}{{Cite web|url=https://lwn.net/ml/linux-kernel/20230306132521.968182689@infradead.org/|title=[PATCH 00/10] sched: EEVDF using latency-nice [LWN.net]|website=LWN.net}} to prevent the need for CFS "latency nice" patches.{{Cite web |title=An EEVDF CPU scheduler for Linux [LWN.net] |url=https://lwn.net/Articles/925371/ |access-date=31 August 2023 |website=LWN.net}} The EEVDF scheduler replaced CFS in version 6.6 of the Linux kernel.
= Synchronization =
The kernel has different causes of concurrency (e.g., interrupts, bottom halves, preemption of kernel and users tasks, symmetrical multiprocessing).{{Rp|page=167}}
For protecting critical regions (sections of code that must be executed atomically), shared memory locations (like global variables and other data structures with global scope), and regions of memory that are asynchronously modifiable by hardware (e.g., having the C volatile
type qualifier), Linux provides a large set of tools. They consist of atomic types (which can only be manipulated by a set of specific operators), spinlocks, semaphores, mutexes,{{cite web|title=locking — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/v5.15/locking/index.html|access-date=17 December 2021|website=Kernel.org}}{{rp|pages=176–198}}{{cite web|title=locking.rst - Documentation/kernel-hacking/locking.rst - Linux source code (v5.11.10) - Bootlin|url=https://elixir.bootlin.com/linux/v5.11.10/source/Documentation/kernel-hacking/locking.rst|access-date=29 March 2021|website=elixir.bootlin.com}} and lockless algorithms (e.g., RCUs).{{cite web|title=What is RCU, Fundamentally? [LWN.net]|url=https://lwn.net/Articles/262464/|access-date=29 March 2021|website=lwn.net}}{{cite web|title=What is RCU? Part 2: Usage [LWN.net]|url=https://lwn.net/Articles/263130/|access-date=29 March 2021|website=lwn.net}}{{cite web|title=RCU part 3: the RCU API [LWN.net]|url=https://lwn.net/Articles/264090/|access-date=29 March 2021|website=lwn.net}} Most lock-less algorithms are built on top of memory barriers for the purpose of enforcing memory ordering and prevent undesired side effects due to compiler optimization.{{cite web|title=Linux-Kernel Memory Model|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2020/p0124r7.html|access-date=29 March 2021|website=open-std.org}}{{cite web|title=A formal kernel memory-ordering model (part 1) [LWN.net]|url=https://lwn.net/Articles/718628/|access-date=29 March 2021|website=lwn.net}}{{cite web|title=A formal kernel memory-ordering model (part 2) [LWN.net]|url=https://lwn.net/Articles/720550/|access-date=29 March 2021|website=lwn.net}}{{cite web|last=Stern|first=Alan|title=Explanation of the Linux-Kernel Memory Consistency Model|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/memory-model/Documentation/explanation.txt}}
PREEMPT_RT
code included in mainline Linux provide RT-mutexes, a special kind of Mutex which do not disable preemption and have support for priority inheritance.{{cite web|title=kernel/git/torvalds/linux.git - Linux kernel source tree|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e5e726f7bb9f711102edea7e5bd511835640e3b4|access-date=17 December 2021|website=git.kernel.org}}{{cite web|title=Lock types and their rules — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/v5.15/locking/locktypes.html|access-date=17 December 2021|website=Kernel.org}} Almost all locks are changed into sleeping locks when using configuration for realtime operation.{{cite web|url=https://lwn.net/Articles/866112/ |title=Short subjects: Realtime, Futexes, and ntfs3 |website=Lwn.net |date= |access-date=20 February 2022}} Priority inheritance avoids priority inversion by granting a low-priority task which holds a contended lock the priority of a higher-priority waiter until that lock is released.{{Cite web|url=https://www.kernel.org/doc/html/latest/locking/rt-mutex.html|title=RT-mutex subsystem with PI support — The Linux Kernel documentation|website=Kernel.org|access-date=20 February 2022}}{{cite web|url=https://www.kernel.org/doc/html/latest/locking/rt-mutex-design.html|title = RT-mutex implementation design — the Linux Kernel documentation}}
Linux includes a kernel lock validator called Lockdep.{{cite web |title=Runtime locking correctness validator — The Linux Kernel documentation |url=https://www.kernel.org/doc/html/latest/locking/lockdep-design.html |access-date=17 December 2021 |website=Kernel.org |language=en}}{{cite web|title=Interrupts, threads, and lockdep [LWN.net]|url=https://lwn.net/Articles/321663/|access-date=17 December 2021|website=lwn.net}}
= Interrupts =
Although the management of interrupts could be seen as a single job, it is divided into two. This split in two is due to the different time constraints and to the synchronization needs of the tasks whose the management is composed of. The first part is made up of an asynchronous interrupt service routine that in Linux is known as the top half, while the second part is carried out by one of three types of the so-called bottom halves (softirq, tasklets, and work queues).{{Rp|pages=133–137}}
Linux interrupt service routines can be nested. A new IRQ can trap into a high priority ISR that preempts any other lower priority ISR.
= Memory =
{{See also|Memory management|Virtual memory}}
Linux kernel manages both physical and virtual memory. Kernel divides physical memory into zones,{{Cite web|url=https://docs.kernel.org/mm/physical_memory.html|title=Physical Memory — The Linux Kernel documentation|website=docs.kernel.org}} each zone has specific purpose.
- ZONE_DMA: this zone is suitable for DMA.
- ZONE_NORMAL: for normal memory operations.
- ZONE_HIGHMEM: part of physical that is only accessible to kernel uisng temporary mapping.
Those zones are most common others exist as the official documentation.
And when it comes to virtual memory Linux implements virtual memory with 4 or 5-level page tables.{{Cite web |title=Page Tables — The Linux Kernel documentation |url=https://www.kernel.org/doc/html/latest/mm/page_tables.html |access-date=2024-07-21 |website=www.kernel.org}} The kernel is not pageable (meaning it is always resident in physical memory and cannot be swapped to the disk) and there is no memory protection (no SIGSEGV signals, unlike in user space), therefore memory violations lead to instability and system crashes.{{Rp|page=20}} User memory is pageable by default, although paging for specific memory areas can be disabled with the mlock()
system call family.
Page frame information is maintained in apposite data structures (of type {{Mono|struct page}}) that are populated immediately after boot and kept until shutdown, regardless of whether they are associated with virtual pages. The physical address space is divided into different zones, according to architectural constraints and intended use. NUMA systems with multiple memory banks are also supported.{{Cite web |title=Physical Memory — The Linux Kernel documentation |url=https://www.kernel.org/doc/html/latest/mm/physical_memory.html |access-date=2024-07-21 |website=www.kernel.org}}
Small chunks of memory can be dynamically allocated in kernel space via the family of kmalloc()
APIs and freed with the appropriate variant of kfree()
. vmalloc()
and kvfree()
are used for large virtually contiguous chunks. alloc_pages()
allocates the desired number of entire pages.
File:The Linux Storage Stack Diagram.svg
The kernel used to include the SLAB, SLUB and SLOB allocators as configurable alternatives.{{cite web |url=https://lwn.net/Articles/229984/ |title=The SLUB allocator |website=Lwn.net |date=11 April 2007 |access-date=20 February 2022}}{{cite web|url=https://events.static.linuxfound.org/sites/events/files/slides/slaballocators.pdf|title=Slab allocators in the Linux Kernel: SLAB, SLOB, SLUB|website=Events.static.linuxfound.org|access-date=20 February 2022}} The SLOB allocator was removed in Linux 6.4{{Cite web |last=Corbet |first=Jonathan |title=6.4 Merge window, part 1 [LWN.net] |url=https://lwn.net/Articles/930068/ |date=28 April 2023 |access-date=12 May 2023 |website=LWN.net}} and the SLAB allocator was removed in Linux 6.8.{{Cite web |title=The first half of the 6.8 merge window [LWN.net] |url=https://lwn.net/Articles/957188/ |access-date=2024-07-21 |website=lwn.net}} The sole remaining allocator is SLUB, which aims for simplicity and efficiency, is PREEMPT_RT
compatible{{cite web |title=Kernel/Git/Torvalds/Linux.git - Linux kernel source tree |url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc09ee80c3b18ae1a897a30a17fe710b2b2f620a |website=Git.kernel.org}} and was introduced in Linux 2.6.
=Virtual filesystem=
{{See also | Virtual file system | Virtual filesystem}}
It is the subsystem that implements filesystem and everything related to filesystem. Linux supports a nomorous amount of filesystems with different features and functionality. Because of that it was necessary to implement generic filesystem that is independent from underlying filesystem. Virtual filesystem exposes other linux subsystems or userspace, APIs that abstract away the different implementation of underlying filesystem. VFS implements system calls like creat,open,read,write and close.
VFS implements generic super block{{Cite web|url=https://docs.oracle.com/cd/E19683-01/806-4073/fsfilesysappx-3/index.html|title=The Superblock (System Administration Guide: Basic Administration)|website=docs.oracle.com}} and Inode block that is independent from the one that the underlying filesystem has.
In this subsystem directories and files are represented by a data structure (struct file). When userspace requests access to a file it returned a file descriptor (non negative integer value) but in the kernel side it is struct file structure. That structure stores everything the kernel need to know about a file or directory.
sysfs and procfs are virtual filesystems that expose userspace programs runtime and hardware information. Those filesystems aren't present in disk and instead the kernel implements as a callbacks or routines get called when those files accessed by userspace.
= Supported architectures =
{{See also|List of Linux-supported computer architectures|Linux-powered device}}
File:Series 2 tivo front.jpg DVR, a consumer device running Linux]]
While not originally designed to be portable,{{cite book |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=January 1999 |title=Open Sources: Voices from the Open Source Revolution |chapter-url=https://archive.org/details/isbn_9781565925823 |publisher=O'Reilly |chapter=The Linux Edge |isbn=1-56592-582-3 |access-date=13 October 2013}} Linux is now one of the most widely ported operating system kernels, running on a diverse range of systems from the ARM architecture to IBM z/Architecture mainframe computers. The first port was performed on the Motorola 68000 platform. The modifications to the kernel were so fundamental that Torvalds viewed the Motorola version as a fork and a "Linux-like operating system". However, that moved Torvalds to lead a major restructure of the code to facilitate porting to more computing architectures. The first Linux that, in a single source tree, had code for more than i386 alone, supported the DEC Alpha AXP 64-bit platform.{{cite web|url=https://www.linuxjournal.com/article/1178?page=0,1|title=Porting Linux to the DEC Alpha: The Kernel and Shell|access-date=5 October 2019|archive-date=5 September 2019|archive-url=https://web.archive.org/web/20190905215158/https://www.linuxjournal.com/article/1178?page=0,1|url-status=live}}{{cite web|title=Linux on Alpha: A Strategic Choice|url=https://www.linuxjournal.com/article/1150?page=0,0|access-date=5 October 2019|archive-date=4 September 2019|archive-url=https://web.archive.org/web/20190904234429/https://www.linuxjournal.com/article/1150?page=0,0|url-status=live}}
Linux runs as the main operating system on IBM's Summit; {{as of|2019|10|lc=y}}, all of the world's 500 fastest supercomputers run some operating system based on the Linux kernel,{{cite web |url=https://www.top500.org/statistics/details/osfam/1 |title=TOP500 Supercomputer Sites: Operating system Family / Linux |publisher=Top500.org |access-date=5 October 2019 |archive-date=19 November 2012 |archive-url=https://web.archive.org/web/20121119205719/https://www.top500.org/statistics/details/osfam/1 |url-status=live}} a big change from 1998 when the first Linux supercomputer got added to the list.{{cite web| url=https://www.top500.org/system/166763| title=Avalon Cluster {{!}} TOP500 Supercomputer Sites| website=Top500.org| access-date=5 October 2019| archive-date=5 October 2019| archive-url=https://web.archive.org/web/20191005210605/https://www.top500.org/system/166763| url-status=live}}
Linux has also been ported to various handheld devices such as Apple's iPhone 3G and iPod.{{cite web |url=https://www.pcworld.com/article/195789/android_now_running_on_iphone_3g.html |title=Android Now Running On iPhone 3G |last=Wang |first=David |date=6 May 2010 |work=TechHive |publisher=IDG |access-date=11 July 2010 |archive-date=22 July 2010 |archive-url=https://web.archive.org/web/20100722023655/http://www.pcworld.com/article/195789/android_now_running_on_iphone_3g.html |url-status=live}}
= Supported devices =
In 2007, the LKDDb project has been started to build a comprehensive database of hardware and protocols known by Linux kernels.{{cite web | url = https://cateee.net/lkddb/ | title = LKDDb | access-date = 26 January 2021 | publisher = LKDDb Project | archive-date = 25 February 2021 | archive-url = https://web.archive.org/web/20210225020934/https://cateee.net/lkddb/ | url-status = live}} The database is built automatically by static analysis of the kernel sources. Later in 2014, the Linux Hardware project was launched to automatically collect a database of all tested hardware configurations with the help of users of various Linux distributions.{{cite web | url = https://linux-hardware.org/ | title = Linux Hardware | access-date = 26 January 2021 | publisher = Linux Hardware Project | archive-date = 26 January 2021 | archive-url = https://web.archive.org/web/20210126054431/https://linux-hardware.org/ | url-status = live}}
= Live patching =
{{update section|date=September 2023|updated=April 2015}}
Rebootless updates can even be applied to the kernel by using live patching technologies such as Ksplice, kpatch and kGraft. Minimalistic foundations for live kernel patching were merged into the Linux kernel mainline in kernel version 4.0, which was released on 12 April 2015. Those foundations, known as livepatch and based primarily on the kernel's ftrace functionality, form a common core capable of supporting hot patching by both kGraft and kpatch, by providing an application programming interface (API) for kernel modules that contain hot patches and an application binary interface (ABI) for the userspace management utilities. However, the common core included into Linux kernel 4.0 supports only the x86 architecture and does not provide any mechanisms for ensuring function-level consistency while the hot patches are applied.
= Security =
Kernel bugs present potential security issues. For example, they may allow for privilege escalation or create denial-of-service attack vectors. Over the years, numerous bugs affecting system security were found and fixed.{{cite book |last1=Mookhey |first1=K. K. |last2=Burghate |first2=Nilesh |date=1 July 2005 |title=Linux: Security, Audit and Control Features |url=https://books.google.com/books?id=-kD0sxQ0EkIC&pg=PA14 |location=US |publisher=ISACA |page=14 |isbn=1-893209-78-4 |access-date=31 December 2010 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602223234/http://books.google.com/books?id=-kD0sxQ0EkIC&pg=PA14 |url-status=live}} New features are frequently implemented to improve the kernel's security.{{cite book |last=Hatch |first=Brian |date=15 July 2008 |title=Hacking Exposed Linux: Linux Security Secrets and Solutions |url=https://books.google.com/books?id=f5Vz08spzw8C&pg=PA524 |publisher=McGraw-Hill Osborne Media |page=524 |isbn=978-0-07-226257-5 |access-date=31 December 2010 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602212901/http://books.google.com/books?id=f5Vz08spzw8C&pg=PA524 |url-status=live}}{{cite book |last=Jaeger |first=Trent |date=7 October 2008 |title=Operating System Security |url=https://books.google.com/books?id=P4PYPSv8nBMC&pg=PA122 |publisher=Morgan and Claypool Publishers |page=122 |isbn=978-1-59829-212-1 |access-date=31 December 2010 |archive-date=2 June 2013 |archive-url=https://web.archive.org/web/20130602203613/http://books.google.com/books?id=P4PYPSv8nBMC&pg=PA122 |url-status=live}}
Capabilities(7) have already been introduced in the section about the processes and threads. Android makes use of them and systemd gives administrators detailed control over the capabilities of processes.{{cite web|title=CAP_PERFMON — and new capabilities in general [LWN.net]|url=https://lwn.net/Articles/812719/|access-date=2 August 2020|website=lwn.net|archive-date=4 August 2020|archive-url=https://web.archive.org/web/20200804030704/https://lwn.net/Articles/812719/|url-status=live}}
Linux offers a wealth of mechanisms to reduce kernel attack surface and improve security which are collectively known as the Linux Security Modules (LSM).{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/LSM/index.html|title=Linux Security Module Usage — The Linux Kernel documentation|website=Kernel.org|access-date=10 January 2020|archive-date=2 May 2020|archive-url=https://web.archive.org/web/20200502142406/https://www.kernel.org/doc/html/latest/admin-guide/LSM/index.html|url-status=live}} They comprise the Security-Enhanced Linux (SELinux) module, whose code has been originally developed and then released to the public by the NSA,{{cite web|url=https://www.nsa.gov/What-We-Do/Research/SELinux/FAQs/|title=National Security Agency {{!}} Central Security Service > What We Do > Research > SE Linux > SE Linux FAQs|website=Nsa.gov|access-date=10 January 2020|archive-date=18 September 2019|archive-url=https://web.archive.org/web/20190918022139/https://www.nsa.gov/What-We-Do/Research/SELinux/FAQs/|url-status=live}} and AppArmor{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/LSM/apparmor.html|title=AppArmor — The Linux Kernel documentation|website=Kernel.org|access-date=10 January 2020|archive-date=8 May 2020|archive-url=https://web.archive.org/web/20200508080035/https://www.kernel.org/doc/html/latest/admin-guide/LSM/apparmor.html|url-status=live}} among others. SELinux is now actively developed and maintained on GitHub.{{cite web|url=https://github.com/SELinuxProject|title=SELinux Project|website=GitHub|language=en|access-date=10 January 2020|archive-date=12 December 2019|archive-url=https://web.archive.org/web/20191212214729/https://github.com/SELinuxProject|url-status=live}} SELinux and AppArmor provide support to access control security policies, including mandatory access control (MAC), though they profoundly differ in complexity and scope.
Another security feature is the Seccomp BPF (SECure COMPuting with Berkeley Packet Filters) which works by filtering parameters and reducing the set of system calls available to user-land applications.{{cite web|url=https://www.kernel.org/doc/html/latest/userspace-api/seccomp_filter.html|title=Seccomp BPF (SECure COMPuting with filters) — The Linux Kernel documentation|website=Kernel.org|access-date=10 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065527/https://www.kernel.org/doc/html/latest/userspace-api/seccomp_filter.html|url-status=live}}
Critics have accused kernel developers of covering up security flaws, or at least not announcing them; in 2008, Torvalds responded to this with the following:{{cite web|url=http://kerneltrap.org/Linux/Security_Bugs_and_Full_Disclosure |title=Security Bugs and Full Disclosure |last=Andrews |first=Jeremy |date=16 July 2008 |publisher=KernelTrap |access-date=31 December 2010 |archive-url=https://web.archive.org/web/20080719130436/http://kerneltrap.org/Linux/Security_Bugs_and_Full_Disclosure |archive-date=19 July 2008 |url-status=dead}}{{cite mailing list |url=http://seclists.org/fulldisclosure/2008/Jul/276 |title=Linux's unofficial security-through-coverup policy |last=Spengler |first=Brad |date=16 July 2008 |mailing-list=Full Disclosure |access-date=31 December 2010 |archive-date=7 August 2020 |archive-url=https://web.archive.org/web/20200807161645/https://seclists.org/fulldisclosure/2008/Jul/276 |url-status=live}}
{{blockquote|I personally consider security bugs to be just "normal bugs". I don't cover them up, but I also don't have any reason what-so-ever to think it's a good idea to track them and announce them as something special...one reason I refuse to bother with the whole security circus is that I think it glorifies—and thus encourages—the wrong behavior. It makes "heroes" out of security people, as if the people who don't just fix normal bugs aren't as important. In fact, all the boring normal bugs are way more important, just because there's[sic] a lot more of them. I don't think some spectacular security hole should be glorified or cared about as being any more "special" than a random spectacular crash due to bad locking.}}
Linux distributions typically release security updates to fix vulnerabilities in the Linux kernel. Many offer long-term support releases that receive security updates for a certain Linux kernel version for an extended period of time.
Legal
= Licensing terms =
Initially, Torvalds released Linux under a license which forbade any commercial use.{{cite web|url=http://hotwired.goo.ne.jp/matrix/9709/5_linus.html |title=The Pragmatist of Free Software |last=Yamagata |first=Hiroo |date=3 August 1997 |publisher=HotWired |access-date=21 February 2007 |archive-url=https://web.archive.org/web/20070210224351/http://hotwired.goo.ne.jp/matrix/9709/5_linus.html |archive-date=10 February 2007 |url-status=dead}} This was changed in version 0.12 by a switch to the GNU General Public License version 2 (GPLv2). This license allows distribution and sale of possibly modified and unmodified versions of Linux but requires that all those copies be released under the same license and be accompanied by - or that, on request, free access is given to - the complete corresponding source code.{{cite web|url=https://www.gnu.org/licenses/old-licenses/gpl-2.0.html|title=GPL-v2|website=gnu.org|access-date=28 January 2020|archive-date=25 December 2019|archive-url=https://web.archive.org/web/20191225033729/https://www.gnu.org/licenses/old-licenses/gpl-2.0.html|url-status=live}} Torvalds has described licensing Linux under the GPLv2 as the "best thing I ever did".
The Linux kernel is licensed explicitly under GNU General Public License version 2 only (GPL-2.0-only) with an explicit syscall exception (Linux-syscall-note), without offering the licensee the option to choose any later version, which is a common GPL extension. Contributed code must be available under GPL-compatible license.
There was considerable debate about how easily the license could be changed to use later GPL versions (including version 3), and whether this change is even desirable.{{cite web |url=https://lwn.net/Articles/169797/ |title=GPLv3 and the kernel |last=Corbet |first=Jonathan |date=31 January 2006 |publisher=LWN.net |access-date=21 February 2007 |archive-date=10 August 2020 |archive-url=https://web.archive.org/web/20200810165701/https://lwn.net/Articles/169797/ |url-status=live}} Torvalds himself specifically indicated upon the release of version 2.4.0 that his own code is released only under version 2.{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0009.1/0096.html |title=Linux-2.4.0-test8 |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=8 September 2000 |mailing-list=LKML |access-date=21 February 2007 |archive-date=15 May 2020 |archive-url=https://web.archive.org/web/20200515235654/http://lkml.iu.edu/hypermail/linux/kernel/0009.1/0096.html |url-status=live}} However, the terms of the GPL state that if no version is specified, then any version may be used,{{cite web|url=https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#section9|title=gnu.org|website=Gnu.org|language=en|access-date=18 October 2017|archive-date=2 February 2021|archive-url=https://web.archive.org/web/20210202151435/https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#section9|url-status=live}} and Alan Cox pointed out that very few other Linux contributors had specified a particular version of the GPL.{{cite mailing list |url=https://lwn.net/Articles/169831/ |title=Re: GPL V3 and Linux |last=Cox |first=Alan |author-link=Alan Cox (computer programmer) |date=20 January 2006 |mailing-list=LKML |access-date=21 February 2007 |archive-date=26 January 2021 |archive-url=https://web.archive.org/web/20210126131909/https://lwn.net/Articles/169831/ |url-status=live}}
In September 2006, a survey of 29 key kernel programmers indicated that 28 preferred GPLv2 to the then-current GPLv3 draft. Torvalds commented, "I think a number of outsiders... believed that I personally was just the odd man out because I've been so publicly not a huge fan of the GPLv3."{{cite web |url=http://news.com/Top+Linux+programmers+pan+GPL+3/2100-7344_3-6119372.html |archive-url=https://archive.today/20130914090740/http://news.com/Top+Linux+programmers+pan+GPL+3/2100-7344_3-6119372.html |url-status=dead |archive-date=14 September 2013 |title=Top Linux programmers pan GPL 3 |date=25 September 2006 |last=Shankland |first=Stephen |work=News.com |publisher=CNET |access-date=21 February 2007 }} This group of high-profile kernel developers, including Torvalds, Greg Kroah-Hartman and Andrew Morton, commented on mass media about their objections to the GPLv3. They referred to clauses regarding DRM/tivoization, patents, "additional restrictions" and warned a Balkanisation of the "Open Source Universe" by the GPLv3.{{cite web |url=https://lwn.net/Articles/200422/ |title=Kernel developers' position on GPLv3: The Dangers and Problems with GPLv3 |author1=James E.J. Bottomley |author2=Mauro Carvalho Chehab |author3=Thomas Gleixner |author4=Christoph Hellwig |author5=Dave Jones |author6=Greg Kroah-Hartman |author7=Tony Luck |author8=Andrew Morton |author9=Trond Myklebust |author10=David Woodhouse |date=15 September 2006 |publisher=LWN.net |access-date=11 March 2015 |archive-date=18 January 2021 |archive-url=https://web.archive.org/web/20210118015213/https://lwn.net/Articles/200422/ |url-status=live}}{{cite web |url=http://www.linuxjournal.com/node/1000100 |title=A fight against evil or a fight for attention? |date=27 September 2006 |first=Nicholas |last=Petreley |publisher=linuxjournal.com |access-date=11 March 2015 |archive-date=2 March 2018 |archive-url=https://web.archive.org/web/20180302144635/http://www.linuxjournal.com/node/1000100 |url-status=live}} Torvalds, who decided not to adopt the GPLv3 for the Linux kernel, reiterated his criticism even years later.{{cite web |url=https://www.youtube.com/watch?v=PaKIZ7gJlRU |title=Linus Torvalds says GPL v3 violates everything that GPLv2 stood for |date=2014 |publisher=Debconf 2014 |access-date=21 March 2018 |archive-date=8 May 2018 |archive-url=https://web.archive.org/web/20180508034417/https://www.youtube.com/watch?v=PaKIZ7gJlRU |url-status=live}}
= Loadable kernel modules =
It is debated whether some loadable kernel modules (LKMs) are to be considered derivative works under copyright law, and thereby whether or not they fall under the terms of the GPL.
In accordance with the license rules, LKMs using only a public subset of the kernel interfaces are non-derived works, thus Linux gives system administrators the mechanisms to load out-of-tree binary objects into the kernel address space.
There are some out-of-tree loadable modules that make legitimate use of the dma_buf kernel feature.{{cite web |url=http://elinux.org/images/a/a8/DMA_Buffer_Sharing-_An_Introduction.pdf |title=DMA Buffer Sharing Framework: An Introduction |last1=Clark |first1=Rob |last2=Semwal |first2=Sumit |date=1 November 2012 |publisher=Embedded Linux Conference |access-date=2 August 2014 |archive-date=8 August 2014 |archive-url=https://web.archive.org/web/20140808051804/http://elinux.org/images/a/a8/DMA_Buffer_Sharing-_An_Introduction.pdf |url-status=live}} GPL compliant code can certainly use it. However, a different possible use case would be Nvidia Optimus that pairs a fast GPU with an Intel integrated GPU, where the Nvidia GPU writes into the Intel framebuffer when it is active. But, Nvidia cannot use this infrastructure because it necessitates bypassing a rule that can only be used by LKMs that are also GPL. Alan Cox replied on LKML, rejecting a request from one of Nvidia's engineers to remove this technical enforcement from the API.{{cite mailing list |url=http://lists.freedesktop.org/archives/dri-devel/2012-October/028846.html |title=[PATCH] dma-buf: Use EXPORT_SYMBOL |last=Cox |first=Alan |author-link=Alan Cox (computer programmer) |date=10 October 2012 |mailing-list=Direct Rendering Infrastructure |access-date=3 September 2013 |archive-date=22 January 2013 |archive-url=https://web.archive.org/web/20130122222858/http://lists.freedesktop.org/archives/dri-devel/2012-October/028846.html |url-status=live}} Torvalds clearly stated on the LKML that "[I] claim that binary-only kernel modules ARE derivative "by default"'".{{cite mailing list |url=https://lkml.org/lkml/2003/12/10/123 |title=RE: Linux GPL and binary module exception clause? |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=10 December 2003 |mailing-list=LKML |access-date=31 December 2010 |archive-date=15 June 2011 |archive-url=https://web.archive.org/web/20110615102501/http://lkml.org/lkml/2003/12/10/123 |url-status=live}}
On the other hand, Torvalds has also said that "[one] gray area in particular is something like a driver that was originally written for another operating system (i.e., clearly not a derived work of Linux in origin). THAT is a gray area, and _that_ is the area where I personally believe that some modules may be considered to not be derived works simply because they weren't designed for Linux and don't depend on any special Linux behaviour".{{cite mailing list |url=http://lkml.iu.edu/hypermail/linux/kernel/0312.0/0670.html |title=Re: Linux GPL and binary module exception clause? |last=Torvalds |first=Linus |author-link=Linus Torvalds |date=3 December 2003 |mailing-list=LKML |access-date=12 November 2010 |archive-date=28 April 2020 |archive-url=https://web.archive.org/web/20200428052533/http://lkml.iu.edu/hypermail/linux/kernel/0312.0/0670.html |url-status=live}} Proprietary graphics drivers, in particular, are heavily discussed.
Whenever proprietary modules are loaded into Linux, the kernel marks itself as being "tainted",{{cite web|url=https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html|title=Tainted kernels — The Linux Kernel documentation|website=Kernel.org|access-date=13 January 2020|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065211/https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html|url-status=live}} and therefore bug reports from tainted kernels will often be ignored by developers.
= Firmware binary blobs =
The official kernel, that is the Linus git branch at the kernel.org repository, contains binary blobs released under the terms of the GNU GPLv2 license. Linux can also search filesystems to locate binary blobs, proprietary firmware, drivers, or other executable modules, then it can load and link them into kernel space.{{cite web|url=https://www.kernel.org/doc/html/latest/driver-api/firmware/index.html|title=Linux Firmware API — The Linux Kernel documentation|website=Kernel.org|access-date=13 January 2020|archive-date=13 January 2020|archive-url=https://web.archive.org/web/20200113174720/https://www.kernel.org/doc/html/latest/driver-api/firmware/index.html|url-status=live}}
When it is needed (e.g., for accessing boot devices or for speed) firmware can be built-in to the kernel, this means building the firmware into vmlinux; however this is not always a viable option for technical or legal issues (e.g., it is not permitted to do this with firmware that is non-GPL compatible, although this is quite common nonetheless).{{cite web|title=Built-in firmware — The Linux Kernel documentation|url=https://www.kernel.org/doc/html/v4.16/driver-api/firmware/built-in-fw.html|access-date=10 June 2020|website=Kernel.org|archive-date=10 June 2020|archive-url=https://web.archive.org/web/20200610041327/https://www.kernel.org/doc/html/v4.16/driver-api/firmware/built-in-fw.html|url-status=live}}
= Trademark =
Linux is a registered trademark of Linus Torvalds in the United States, the European Union, and some other countries.{{cite web|url=http://tmsearch.uspto.gov/bin/showfield?f=doc&state=4808:r0ouik.2.17|title=Linux TM registration in the US|website=uspto.gov|access-date=6 September 2019|archive-date=24 February 2021|archive-url=https://web.archive.org/web/20210224164104/http://tmsearch.uspto.gov/bin/showfield?f=doc&state=4808:r0ouik.2.17|url-status=live}}{{cite web|url=https://euipo.europa.eu/eSearch/#details/trademarks/000851246|title=Linux TM registration in the EU|website=euipo.europa.eu|access-date=28 November 2020|archive-date=9 June 2016|archive-url=https://web.archive.org/web/20160609153529/https://euipo.europa.eu/eSearch/#details/trademarks/000851246|url-status=live}} A legal battle over the trademark began in 1996, when William Della Croce, a lawyer who was never involved in the development of Linux, started requesting licensing fees for the use of the word Linux. After it was proven that the word was in common use long before Della Croce's claimed first use, the trademark was awarded to Torvalds.{{cite web|url=http://www.linuxjournal.com/article/2425/|title=Linux Trademark Dispute|last=Hughes|first=Phil|date=1 August 1997|work=Linux Journal|publisher=Belltown Media, Inc.|access-date=8 December 2010|archive-date=30 April 2010|archive-url=https://web.archive.org/web/20100430060209/http://www.linuxjournal.com/article/2425|url-status=live}}{{cite web|url=http://www.linuxjournal.com/article/2098|title=Action Taken on Linux Trademark|last=Hughes|first=Phil|date=1 March 1997|work=Linux Journal|publisher=Belltown Media, Inc.|access-date=8 December 2010|archive-date=3 March 2010|archive-url=https://web.archive.org/web/20100303180921/http://www.linuxjournal.com/article/2098|url-status=live}}{{cite web|url=http://www.gisselberglawfirm.com/downloads/linux.pdf|title=The Trademark History of Linux, the Operating System|last=Gisselberg|first=Tonya|date=2010|publisher=Gisselberg Law Firm, Inc.|access-date=8 December 2010|archive-url=https://web.archive.org/web/20110711095344/http://www.gisselberglawfirm.com/downloads/linux.pdf |archive-date=11 July 2011 |url-status=dead}}
=Removal of Russian maintainers=
In October 2024, kernel developer Greg Kroah-Hartman removed some kernel developers whose email addresses suggested a connection to Russia from their roles as maintainers.{{cite mailing list |url=https://lore.kernel.org/all/2024101835-tiptop-blip-09ed@gregkh/ |title=[PATCH] MAINTAINERS: Remove some entries due to various compliance requirements. |date= |access-date=18 November 2024 |mailing-list=LKML |author=Greg Kroah-Hartman |author-link=Greg_Kroah-Hartman |language=en |quote= |archive-url= |archive-date= |ref=}}{{cite web |last1=Purdy |first1=Kevin |title=Removal of Russian coders spurs debate about Linux kernel's politics |url=https://arstechnica.com/information-technology/2024/10/russian-coders-removed-from-linux-maintainers-list-due-to-sanction-concerns/ |website=Ars Technica |access-date=18 November 2024 |date=24 October 2024}} Linus Torvalds responded that he did not support Russian aggression and would not revert the patch, insinuating that opponents of the patch were Russian trolls.{{cite mailing list |url=https://lore.kernel.org/all/2024101835-tiptop-blip-09ed@gregkh/ |title=Re: [PATCH] Revert "MAINTAINERS: Remove some entries due to various compliance requirements." |date=2024-10-23 |access-date=18 November 2024 |mailing-list=LKML |author=Linus Torvalds |author-link=Linus_Torvalds |language=en |quote= |archive-url= |archive-date= |ref=}} James Bottomley, a kernel developer, issued an apology for the handling of the situation and clarified that the action was a consequence of U.S. sanctions against Russia.{{cite mailing list |url=https://lkml.org/lkml/2024/10/24/1118 |title=Re: linux: Goodbye from a Linux community volunteer |date=2024-10-24 |access-date=18 November 2024 |mailing-list=LKML |author=James Bottomley |language=en}}
See also
{{Portal|Linux|Free and open-source software}}
- {{Annotated link|Linux}}
- {{Annotated link|Linux kernel version history}}
- {{Annotated link|Comparison of operating systems}}
- {{Annotated link|Comparison of operating system kernels}}
- {{Annotated link|Microkernel}}
- {{Annotated link|Minix 3}}
- {{Annotated link|macOS}}
- {{Annotated link|Microsoft Windows}}
Notes
{{notelist}}
References
{{reflist}}
Further reading
{{Refbegin|40em}}
- {{cite book|last1=Torvalds|first1=Linus|last2=Diamond|first2=David|year=2001|title=Just for Fun: The Story of an Accidental Revolutionary|publisher=HarperBusiness|isbn=978-0066620732|title-link=Just for Fun (book)}}
- {{cite book|last=Bezroukov|first=Nikolai|chapter-url=http://www.softpanorama.org/People/Torvalds/index.shtml|title=Portraits of Open Source Pioneers|chapter=Ch 4: A benevolent dictator|publisher=Softpanorama|type=e-book|access-date=3 October 2005|archive-date=13 October 2005|archive-url=https://web.archive.org/web/20051013082354/http://www.softpanorama.org/People/Torvalds/index.shtml|url-status=live}}
- {{cite web|url=https://lwn.net/Articles/53780/|title=LinkSys and binary modules|publisher=LWN.net Weekly Edition|date=16 October 2003|access-date=21 July 2016|archive-date=1 August 2016|archive-url=https://web.archive.org/web/20160801080742/http://lwn.net/Articles/53780/|url-status=live}}
- {{cite web|url=http://www.nd.edu/~ljordan/linux/tuxhistory.html|title=Everyone's Favorite Linux Mascot|access-date=16 June 2005|archive-date=16 August 2005|archive-url=https://web.archive.org/web/20050816235544/http://www.nd.edu/~ljordan/linux/tuxhistory.html|url-status=live}}
- {{cite web|url=http://kniggit.net/wwol26.html|archive-url=https://web.archive.org/web/20030716054145/http://www.kniggit.net/wwol26.html|url-status=dead|archive-date=16 July 2003|title=The Wonderful World of Linux 2.6|last=Pranevich|first=Joseph|date=December 2003}}
- {{cite web|url=http://wiki.kernelnewbies.org/LinuxChanges|title=LinuxChanges|access-date=31 October 2005|archive-date=31 October 2005|archive-url=https://web.archive.org/web/20051031211753/http://wiki.kernelnewbies.org/LinuxChanges|url-status=live}}
- {{cite web|url=http://engineeringproject.net/seminars/linux.htm|title=Seminar Paper on Linux Kernel 2.6|url-status=dead|archive-url=https://web.archive.org/web/20070202002917/http://www.engineeringproject.net/seminars/linux.htm|archive-date=2 February 2007}}
- {{cite web|url=https://lwn.net/Kernel/LDD3/|title=Linux Device Drivers|edition=3rd|access-date=21 July 2016|archive-date=27 July 2016|archive-url=https://web.archive.org/web/20160727085953/http://lwn.net/Kernel/LDD3/|url-status=live}}
- {{cite web|url=http://www.oreilly.com/catalog/understandlk/|title=Understanding the Linux Kernel|edition=3rd|type=Book|access-date=22 December 2005|archive-date=17 December 2005|archive-url=https://web.archive.org/web/20051217094234/http://www.oreilly.com/catalog/understandlk/|url-status=live}}
- {{cite book|url=http://www.apress.com/9781430261964|title=Linux Kernel Networking, by Rami Rosen, 2014|work=SpringerLink |type=Book|access-date=14 June 2015|archive-date=12 May 2015|archive-url=https://web.archive.org/web/20150512052750/http://www.apress.com/9781430261964|url-status=live}}
- {{cite web|url=http://kerneltrap.org/node/1735|title=Linux: The GPL And Binary Modules|url-status=dead|archive-url=https://web.archive.org/web/20050723031159/http://kerneltrap.org/node/1735|archive-date=23 July 2005}}
- {{cite web|url=http://www.ibm.com/developerworks/linux/library/l-linux-kernel/|title=Anatomy of the Linux kernel| website=IBM |access-date=9 June 2007|archive-date=27 June 2007|archive-url=https://web.archive.org/web/20070627093507/http://www.ibm.com/developerworks/linux/library/l-linux-kernel/|url-status=live}}
- {{Cite book|last1=Tanenbaum|first1=Andrew|title=Modern Operating Systems|last2=Bos|first2=Herbert|publisher=Pearson|year=2015|isbn=9781292061429|location=United States of America|page=722|oclc=892574803}}
{{Refend}}
External links
{{Commons}}
{{Wikibooks}}
- {{Official website}}
- [//kernel.org/doc/ Linux kernel documentation index]
- [//kernel.org/doc/man-pages/ Linux kernel man pages]
- [https://bugzilla.kernel.org/ Kernel bugzilla], and [https://bugzilla.kernel.org/show_bug.cgi?id=15790 regressions] for each recent kernel version
- [http://kernelnewbies.org/ Kernel Newbies], a source of various kernel-related information
- [https://lwn.net/Kernel/ Kernel coverage at LWN.net], an authoritative source of kernel-related information
- [https://elixir.bootlin.com/linux/latest/source Bootlin's Elixir Cross Referencer], a Linux kernel source code cross-reference
- {{YouTube|L2SED6sewRw|Greg Kroah Hartman on the Linux kernel}}
- [https://www.geeksforgeeks.org/virtual-file-system Virtual filesystem], linux generic filesystem implementation
{{Linux kernel}}
{{Linux}}
{{Mobile operating systems}}
{{Routing software}}
{{Linux people}}
{{DEFAULTSORT:Linux Kernel}}
Category:Free and open-source software
Category:Free software programmed in C