Content deleted Content added
Guy Harris (talk | contribs) Link only the first occurrence of Linux kernel in the paragraph. |
m Bot: http → https |
||
(37 intermediate revisions by 18 users not shown) | |||
Line 1:
{{Short description|
{{essay-like|date=July 2014}}
[[File:Linux kernel interfaces.svg|thumb|upright=1.5|Linux API, Linux ABI, and in-kernel APIs and ABIs]]
The [[Linux kernel]] provides
== {{Anchor|Linux API}}Linux API ==
[[File:Linux API.svg|thumb|upright=1.5|The '''Linux API''' is composed out of the
[[File:Linux kernel API.svg|thumb|upright=1.5|Linux API vs. [[POSIX]] API]]
The Linux API
| url =
| title = Kernel System Calls
| date = 2006-11-02 | access-date = 2014-11-11
| author = Alessandro Rubini | website = linux.it
}}</ref> It is composed
The Linux API, by choice, has been kept stable over the decades through a policy of not introducing breaking changes; this stability guarantees the portability of [[source code]].<ref>{{cite web
Line 26 ⟶ 23:
| author = Linus Torvalds | publisher = [[Linux kernel mailing list]]
| quote = If a change results in user programs breaking, it's a bug in the kernel. We never EVER blame the user programs.
}}</ref>
Much available [[free and open-source software]] is written for the POSIX API. Since so much more development flows into the Linux kernel as compared to the other POSIX-compliant combinations of kernel and C standard library,{{citation needed|date=July 2014}} the Linux kernel and its API have been augmented with additional features.
At [[FOSDEM]] 2016, [[Michael Kerrisk]] explained some of the perceived issues with the Linux kernel's user-space API, describing that it contains multiple design errors by being non-extensible, unmaintainable, overly complex, of limited purpose, in violation of standards, and inconsistent. Most of those mistakes cannot be fixed because doing so would break the ABI that the kernel presents to the user space.<ref>{{cite web|url=https://archive.fosdem.org/2016/schedule/event/design_linux_kernel_api/|title=How to design a Linux kernel API|author=Michael Kerrisk|author-link=Michael Kerrisk|date=2016-01-31|access-date=2016-02-04}}</ref>
=== {{Anchor|System Call Interface|SCI}} System
The ''
Various issues with the organization of the Linux kernel system calls are being publicly discussed. Issues have been pointed out by Andy Lutomirski, [[Michael Kerrisk]] and others.<ref>{{cite web |url=
=== The C standard library ===
[[File:Linux kernel System Call Interface and glibc.svg|thumb|upright=1.5|The [[GNU C Library]] is a wrapper around the Linux kernel
A [[C standard library]]
* [[glibc]]
Line 49 ⟶ 46:
* [[dietlibc]]
* [[Bionic (software)|libbionic]] and [[Hybris (software)|libhybris]]
Although the landscape is shifting, amongst these options, glibc remains the most popular implementation, to the point of many treating it as the default and the term equivalent to libc.
==== Additions to POSIX ====
Line 58 ⟶ 57:
* The system calls <code>[[futex]]</code> (fast userspace mutex), <code>[[epoll]]</code>, <code>[[splice (system call)|splice]]</code>, <code>[[dnotify]]</code>, <code>[[fanotify]]</code>, and <code>[[inotify]]</code> have been exclusive to the Linux kernel so far.
* The system call <code>[[getrandom]]</code> was introduced in version 3.17 of the [[Linux kernel mainline]]<ref>{{cite web |url=https://lkml.org/lkml/2014/7/17/145 |title=[PATCH, RFC] random: introduce getrandom(2) system call |publisher=[[Linux kernel mailing list|LKML]] |date=2014-07-17}}</ref>
* <code>[[memfd]]</code> was proposed by the [[kdbus]] developers<ref>{{cite web |url=https://github.com/gregkh/kdbus/blob/master/memfd.c |archive-url=https://archive.today/20140422172420/https://github.com/gregkh/kdbus/blob/master/memfd.c |url-status=dead |archive-date=2014-04-22 |title=memfd.c |website=[[GitHub]] }}</ref>
** <code>[[memfd_create]]</code> was merged into the Linux kernel mainline in kernel version 3.17
* <code>[[readahead]]</code> initiates a file "read-ahead" into page cache
[[Direct Rendering Manager|DRM]] has been paramount for the development and implementations of well-defined and performant [[Free and open-source graphics device driver#Software architecture|free and open-source graphics device drivers]] without which no rendering acceleration would be available at all
=== Further libraries ===
Line 69 ⟶ 68:
* libevdev (for [[evdev]])
* libasound ([[Advanced Linux Sound Architecture]])
== Linux ABI ==
{{Expert needed|
[[File:Linux API and Linux ABI.svg|thumb|upright=1.5|The Linux API and
{{Main article|x32 ABI|Linux Standard Base}}
The
An ABI has to be defined for every instruction set, such as [[x86]], [[x86-64]], [[MIPS architecture|MIPS]], [[ARMv7-A]] (32-Bit), [[ARMv8-A]] (64-Bit), etc. with the [[endianness]], if both are supported.
It should be able to compile the software with different compilers against the definitions specified in the ABI and achieve full binary compatibility. Compilers that are [[free and open-source software]] are e.g. [[GNU Compiler Collection]], [[LLVM]]/[[Clang]].
== In-kernel APIs ==
The Linux kernel is a monolithic kernel, hence device drivers are kernel components. To ease the burden of companies maintaining their (proprietary) device drivers
== In-kernel ABIs ==
Since there are no stable in-kernel APIs, there cannot be stable in-kernel ABIs.<ref>{{cite web|url=
== Abstraction APIs ==
[[File:Linux kernel and OpenGL video games.svg|thumb|OpenGL is indeed an abstraction API to make use of diverse GPUs of multiple vendors without the need to program for each one specifically.]]
[[File:Division of labor cpu and gpu.svg|thumb|But the implementation of the OpenGL-specification is executed on the CPU in the context of the running operating system. One design goal of [[Vulkan (API)|Vulkan]] was to make the "graphics driver", i.e. the implementation of the graphics API, do less.]]
For
*
*
* [[Simple DirectMedia Layer]]: abstraction API for input/sound/etc. available for many operating systems.
* [[Simple and Fast Multimedia Library]]: like above.
== See also ==
{{Portal|Linux}}
* ''[[The Linux Programming Interface]]'' by [[Michael Kerrisk]]▼
* {{Annotated link|Hybris (software)}}
* [[Semaphore (programming)]]▼
* {{Annotated link|netlink}}
▲** {{mono|[[File descriptor|eventfd()]]}}
* {{Annotated link|system call}}
* {{Annotated link|Windows API}}
* {{Annotated link|windows.h}}
* {{Annotated link|Wine (software)}}
== References ==
Line 121 ⟶ 117:
*[https://web.archive.org/web/20070227215533/http://www.gnugeneration.com/books/linux/2.6.20/kernel-api/ The API of Linux kernel 2.6.20] and [https://www.kernel.org/doc/htmldocs/kernel-api/ 4.12] (in deprecated htmldocs format)
*[https://abi-laboratory.pro/?view=timeline&l=linux API/ABI changes review for Linux]
* [
*{{usurped|1=[https://archive.today/20121220032539/http://www.makelinux.net/kernel_map/ Interactive Linux kernel map]}} with main API functions and structures, {{usurped|1=[https://web.archive.org/web/20180827040646/http://www.makelinux.net/kernel_map/LKM.pdf PDF]}} version
* {{usurped|1=[https://archive.today/20130221193824/http://www.makelinux.net/ldd3 Linux Device Drivers]}} by Jonathan Corbet, Greg Kroah-Hartman and Alessandro Rubini, 3rd edition
* [http://isis.poly.edu/kulesh/stuff/src/klist/ Linux Kernel Linked List Explained] {{Webarchive|url=https://web.archive.org/web/20090925130610/http://isis.poly.edu/kulesh/stuff/src/klist/ |date=2009-09-25 }}
{{Linux kernel}}
|