Linux kernel
Encyclopedia : L : LI : LIN : Linux kernel
The Linux kernel is a Unix-like operating system kernel that was begun by Linus Torvalds in 1991 and subsequently developed with the assistance of developers worldwide.
Developed under the GNU General Public License (GPL), Linux is free software.
The kernel is best known for its use in the GNU/Linux operating system.
History
The project was launched in 1991. At the time, the GNU project had created many of the components required for a free operating system, but its own kernel project, the GNU Hurd, was incomplete and unavailable. The BSD operating system had not yet freed itself from legal encumbrances. This left a space for the Linux kernel to fill, and despite the limited functionality of the early versions it rapidly accumulated developers and users. Early on, Minix hackers contributed code and ideas to the Linux kernel, and today it has received contributions from thousands of programmers.Timeline
- Apr 1991 - Linus Torvalds, then 21, starts working on some simple ideas for an operating system. He starts with a task switcher in 386 assembly and a terminal driver.
- 25 August 1991 - Torvalds posts to comp.os.minix: [link]
- September 1991 - Linux version 0.01 is released. (10,239 lines of code.)
- October 1991 - Linux version 0.02 is released. [link]
- December 1991 - Linux 0.11 is released. This version is the first that is self-hosted (Linux 0.11 can be compiled under Linux 0.11)
- January 19, 1992 - First post to alt.os.linux newsgroup. [link]
- March 31, 1992 - The newsgroup comp.os.linux is created. [link]
- March 1992 - Linux version 0.95 is the first to be capable of running the X Window System.
- During the whole of 1993, and early 1994 - 15 development versions 0.99.*, with 0.99.11 (July 1993) introducing BogoMips into the kernel
- March 14, 1994 - Linux 1.0.0 is released. (176,250 lines of code.)
- March 1995 - Linux 1.2.0 is released (310,950 lines of code.)
- May 9, 1996 - Tux the penguin is suggested as mascot for Linux
- June 9, 1996 - Linux 2.0.0 is released. (777,956 lines of code.)
- January 25, 1999 - Linux 2.2.0 is released. (1,800,847 lines of code.)
- December 18, 1999 - IBM mainframe patches for 2.2.13 published, bringing Linux into the biggest enterprises.
- January 4, 2001 - Linux 2.4.0 is released. (3,377,902 lines of code.)
- December 17, 2003 - Linux 2.6.0 is released. (5,929,913 lines of code.)
- April 24, 2006 - Linux 2.6.16.11 is released. (6,981,110 lines of code.) [link].
- June 18, 2006 - Linux 2.6.17 is released. [link]
Mascot
The Linux mascot is a penguin named Tux, created by Larry Ewing in May 1996 [link] after an initial suggestion made by Alan Cox [link] and further refined by Linus Torvalds on the Linux Kernel mailing list [link]. The mascot is a penguin because, as Tove Torvalds, his wife, put it, "Linus likes penguins. That's it." [link] The name Tux was suggested to represent (T)orvalds (U)ni(X) [link], and it stuck.Licensing terms
Initially, Torvalds released Linux under a license which forbade any commercial exploitation. This was soon changed to the GNU General Public License (GPL). This license allows distribution and even sale of possibly modified versions of Linux but requires that all those copies be released under the same license and be accompanied by source code.Torvalds has described licensing Linux under the GPL as the "best thing I ever did." [link]
One point of licensing controversy is the kernel's use of firmware "binary blobs" to support some hardware devices. Richard Stallman, author of the GPL, has suggested that kernel versions including such firmware blobs are partially non-free, and may even be violating the GPL (which requires "complete corresponding source code" to be available).[link]
More generally, it is debated whether loadable kernel modules are considered "derived works" under copyright law, and thereby fall under the terms of the GPL. Torvalds has stated his belief that modules using only a limited, "public" subset of the kernel interfaces can sometimes be non-derived works, thus allowing some binary-only drivers and other modules not obeying the GPL. Not all kernel contributors agree with this interpretation, however, and even Torvalds agrees that many kernel modules are clearly derived works, and indeed he writes that "kernel modules ARE derivative 'by default'". 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 (ie. 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." [link] Especially proprietary graphics drivers are heavily discussed. Ultimately, such questions can only be resolved by a court.
Currently, the Linux kernel is licensed under version 2 of the GPL, and there is some controversy over how easily it could be changed to use later GPL versions such as the upcoming version 3 (and whether this is desirable) [link]. Torvalds himself indicated in version 2.4.0 that his own code is only under version 2 [link], but Alan Cox pointed out that very few other kernel contributors have specified a particular version of the GPL [link]. (The terms of the GPL state that if no version is specified, then any version may be used.)
Linux is a registered trademark of Linus Torvalds. This is the result of an incident in which William Della Croce, Jr., who was not involved in the Linux project, trademarked the name and subsequently demanded royalties for its use. Several Linux backers retained legal counsel and filed suit against Della Croce, who agreed in 1998 to assign the trademark to Torvalds.
Litigation
- For more details on this topic, see SCO-Linux controversies.
Technical features
Architecture
The Linux kernel supports true preemptive multitasking, virtual memory, shared libraries, demand loading, shared copy-on-write executables, memory management, and TCP/IP networking.Today Linux is a module-loading monolithic kernel. Device drivers and kernel extensions typically run in ring 0, with full access to the hardware, although some run in user space. Unlike standard monolithic kernels, device drivers are easily configured as modules, and loaded or unloaded while running the system. Also unlike standard monolithic kernels, device drivers can be pre-empted under certain conditions. This latter feature was added to handle hardware interrupts correctly, and to improve support for symmetric multiprocessing. Preemption also improves latency, increasing responsiveness and making Linux more suitable for real-time applications.
The fact that Linux is not a microkernel was the topic of a famous flame war between Linus Torvalds and Andy Tanenbaum on comp.os.minix in 1992. [link]
Kernel panic
In Linux, a "panic" is an unrecoverable system error detected by the kernel as opposed to similar errors detected by user space code. It is possible for kernel code to indicate such a condition by calling the panic function located in the header file sys/system.h. However, most panics are the result of unhandled processor exceptions in kernel code, such as references to invalid memory addresses. These are typically indicative of a bug somewhere in the call chain leading to the panic. They can also indicate a failure of hardware, such as a failed RAM cell or errors in arithmetic functions in the processor caused by a processor bug, overheating/damaged processor, or a soft error.
Programming languages
The Linux kernel is written in that version of the C programming language which is supported by the GNU C compiler (which has introduced a number of extensions and changes to standard C), together with a number of relatively short sections of code written in the assembly language (in GCC's "AT&T-style" syntax) of the target architecture. Because of the extensions to C it supports, GCC was for a long time the only compiler capable of correctly building a Linux kernel. Recently, Intel claims to have modified its C compiler so that it is also capable of correctly compiling the kernel.[link]
Many other languages are used in some way, primarily in connection with the kernel build process (the methods whereby the bootable image is created from the sources). These include Perl, Python, and various shell scripting languages. Some drivers may also be written in C++, Fortran, or other languages, but this behavior is strongly discouraged. The kernel's build system only officially supports the GCC as a kernel and driver compiler.
Portability
While not originally designed to be portable, Linux is now one of the most widely ported operating system kernels, running on a diverse range of systems from the iPAQ (a handheld computer) to the IBM System z9 (a massive mainframe server that can run hundreds or even thousands of concurrent Linux instances), to the iPod (a portable mp3 player). Linux is intended to run as the main operating system on IBM's new Blue Gene supercomputer architecture when it is finished. Torvalds included, perhaps humorously, BogoMips into the kernel as a performance pseudo-comparison tool.It is important to note that Torvalds' efforts were also directed successfully at a different sort of portability. Portability, according to Torvalds, was the ability to easily compile applications from a variety of sources on his system; thus Linux originally became popular in part because it required the least effort to get popular free software and other open source applications running.
Linux currently runs on the following machine architectures:
- ARM
- *Acorn: Archimedes, A5000, Risc PC series and post-Acorn machines, the Iyonix PC
- *StrongARM, Intel XScale etc.
- *Sharp's Zaurus
- *HP's iPAQ
- *Palm's Tungsten (http://palmtelinux.sf.net)
- *Nintendo's DS ([DS Linux Project])
- *Apple's iPod (IPodLinux [iPodLinux Project])
- *Gamepark Holdings' GP2X
- *Nokia's 770
- Axis Communications' ETRAX CRIS
- FujitsuFR-V
- DEC Alpha
- Hewlett Packard's PA-RISC
- Hitachi: SuperH (SEGA Dreamcast), H8/300
- IBM's S/390 (31-bit)
- IBM's zSeries and System z9 mainframes (64-bit)
- Intel 80386 and up: IBM PCs and compatibles with CPUs:
- *80386, 80486, and their AMD, Cyrix, TI and IBM variants
- *the entire Pentium series;
- *AMD 5x86, K5, K6, Athlon (all 32-bit versions), Duron, Sempron;
- *AMD64: AMD's 64-bit processor technology (also known as x86_64) found in the Athlon 64 processors
- *Cyrix 5x86, 6x86 (M1), 6x86MX and MediaGX (National/AMD Geode) series.
- *VIA Technologies VIA C3 and later processors
- *Support for Intel 8086, 8088, 80186, 80188 and 80286 CPUs is under development (see [ELKS] project)
- *Microsoft's Xbox (Pentium III processor) (see Xbox Linux)
- *SGI Visual Workstation (Pentium II/III processor(s) with SGI chipset)
- Intel IA-64
- MIPS
- *Silicon Graphics, Inc.
- *Cobalt Qube, Cobalt Raq
- *Sony PlayStation 2 (see PS2 Linux)
- *DECstation
- *Godson MIPS like
- *many ARC computers, including JAZZ
- *several others
- Motorola 68020 and up:
- *newer Amigas: A1200, A2500, A3000, A4000
- *Apple Macintosh II, LC, Quadra, Centris and early Performa series
- *Sun Microsystems 3-series workstations (experimental, uses Sun-3 MMU)
- *Non-Sun 68020-based machines require the Motorola 68851 PMMU
- NEC v850e
- Renesas M32R
- PowerPC and IBM POWER:
- *IBM's CELL
- *most newer Apple Computers (all PCI-based Power Macintoshes, limited support for the older NuBus Power Macs)
- *clones of the PCI Power Mac marketed by Power Computing, UMAX and Motorola
- *Amigas upgraded with a "Power-UP" card (such as the Blizzard or CyberStorm)
- *IBM RS/6000, iSeries and pSeries systems
- *Pegasos I and II boards
- *Nintendo GameCube (Gamecube Linux)
- *several other embedded PowerPC platforms
- SPARC and UltraSparc: Sun 4-series, SPARCstation/SPARCserver, Ultra, Blade and Fire series workstations and servers, as well as clones made by Tatung and others.
Versions
Further developing his own code and integrating changes made by other programmers, Linus Torvalds keeps releasing new versions of the Linux kernel. These are called "vanilla" kernels, meaning they have not been modified by anyone. Many providers of GNU/Linux operating systems modify the kernels of their product, mainly in order to add support for drivers or features which have not officially been released as stable, while some distributions, such as Slackware, rely on vanilla kernels.Version numbering
The version number of the Linux kernel currently consists of four numbers, following a recent change in the long-standing policy of a three-number versioning scheme. For illustration, let it be assumed that the version number is composed thus: A.B.C[.D] (e.g. 2.2.1, 2.4.13 or 2.6.12.3).
- The A number denotes the kernel version. It is changed least frequently, and only when major changes in the code and the concept of the kernel occur. It has been changed twice in the history of the kernel: In 1994 (version 1.0) and in 1996 (version 2.0).
- The B number denotes the major revision of the kernel.
- *Prior to the Linux 2.6.x series, even numbers indicate a stable release, i.e. one that is deemed fit for production use, such as 1.2, 2.4 or 2.6. Odd numbers have historically been development releases, such as 1.1 or 2.5. They were for testing new features and drivers until they became sufficiently stable to be included in a stable release.
- *Starting with the Linux 2.6.x series, there is no significance to even or odd numbers, with new feature development going on in the same kernel series. Linus Torvalds has stated that this will be the model for the foreseeable future.
- The C number indicates the minor revision of the kernel. In the old three-number versioning scheme, this was changed when security patches, bugfixes, new features or drivers were implemented in the kernel. With the new policy, however, it is only changed when new drivers or features are introduced; minor fixes are handled by the D number.
- A D number first occurred when a grave error, which required immediate fixing, was encountered in 2.6.8's NFS code. However, there were not enough other changes to legitimize the release of a new minor revision (which would have been 2.6.9). So, 2.6.8.1 was released, with the only change being the fix of that error. With 2.6.11, this was adopted as the new official versioning policy. Bug-fixes and security patches are now managed by the fourth number, whereas bigger changes are only implemented in minor revision changes (the C number).
Maintenance
While Linus Torvalds supervises code changes and releases to the latest kernel versions, he has delegated the maintenance of older versions to other programmers:
| Kernel series | Maintainer |
|---|---|
| 2.0 | David Weinehall |
| 2.2 | Marc-Christian Petersen (formerly Alan Cox) |
| 2.4 | Marcelo Tosatti |
| 2.6 | Andrew Morton / Linus Torvalds |
Other Linux kernel programmers include Robert Love and Ingo Molnar. (See the [Linux MAINTAINERS file]).
Stable version history
- Version 1.0 of March 1994 supported only single-processor i386 machines.
- Version 1.2 of March 1995 added support for Alpha, Sparc and MIPS.
- Version 2.0 of June 1996 added support for more processors and included SMP support.
- Version 2.2 of January 1999 ([The Wonderful World of Linux 2.2]).
- Version 2.4.0 of January 2001
- *CPU support: Hewlett-Packard's PA-RISC processor, Axis Communications' ETRAX CRIS ("Code Reduced Instruction Set") processors
- *added ISA Plug-and-Play
- *added USB and PC Card support
- *2.4.6: added Bluetooth support
- *Filesystem and data storage
- **added Logical Volume Manager version 1 (LVM)
- **support for RAID devices
- **2.4.15: Support for InterMezzo filesystem were added.
- *For more information see article: [Wonderful World of Linux 2.4]
- Version 2.6 - current (December 17, 2003 to the present)
- *integrated uClinux (for microcontrollers)
- *CPU support: with support for Hitachi's H8/300 series, the NEC v850, and Motorola's embedded m68k processors, NUMA support, support for NCR's Voyager architecture, support for Intel's hyperthreading and PAE ("Physical Address Extension")
- *integrated the ALSA sound driver
- *OS support:
- **Improved APIC support.
- **Increased the maximum number of users and groups from 65,000 to over 4 billion.
- **Increased the maximum number of process ids from 32,000 to 1 billion.
- **Increased the maximum number of device types (major device) from 255 to 4095 and the maximum number of devices of each type (minor device) from 255 to more than a million.
- **Improved 64-bit support and filesystems of up to 16 terabytes on common hardware.
- **Improvements to the "overall responsiveness" for interactive processes (the kernel became fully pre-emptible and the I/O scheduler was rewritten).
- **Support for futexes, a rewrite of threading infrastructure to allow the Native POSIX Thread Library (NPTL) to be used.
- **An improved module loader.
- **User-mode Linux integration.
- **2.6.11 Infiniband support
- *Storage Support:
- **LVM updated to version 2
- **support for SGI's XFS filesystem.
- **A new "system filesystem" called sysfs, destined to relieve procfs of its system related information.
- **2.6.12 (17 June 2005) iSCSI support
- **2.6.13 inotify support
- **2.6.14 9P support
- **2.6.14 FUSE support
- *(and more changes: [The Wonderful World of Linux 2.6])
References
- (audio tape, abridged ed., read by David Diamond) - on the beginnings of the Linux kernel
- [link], Nikolai Bezroukov. Portraits of Open Source Pioneers. Ch 4: A benevolent dictator (Softpanorama e-book).
- Revolution OS - a documentary on the history of Linux featuring several interviews with prominent hackers, including Torvalds
- [link], FreeBSD/Linux kernel source code cross-reference. Browsable Linux (and other operating system) kernel source cross-reference.
| Linux |
| Linux distributions - Comparison of Linux distributions |
| Open source - Linus's law - Linus Torvalds |
| Linux kernel - GNU/Linux naming controversy |
