Linux kernel
|
Tux.png
Linux kernel is a free unix-like operating system kernel created by Linus Torvalds in 1991 and subsequently improved with the assistance of developers around the world.
It was originally developed for the Intel 80386 processor but has since been ported to many other platforms. It is written almost entirely in C with some GNU C language extensions, along with snippets of assembly language (in the GNU Assembler's "AT&T-style" syntax).
Developed under the GNU General Public License, the source code for Linux is free software.
The kernel is best known as the core of GNU/Linux operating systems. Distributions of software based on this kernel are called GNU/Linux distributions.
Contents |
History
The project was launched in 1991 with a famous post to the Usenet newsgroup comp.os.minix that includes this sentence:
- "I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones..." [1] (http://groups.google.com/groups?hl=en&selm=1991Aug25.205708.9541%40klaava.Helsinki.FI)
At the time, the GNU project had created many of the components required for a free operating system, but its own kernel, 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.
Originally, "Linux" was only the name of the kernel. The term "kernel" properly refers to the low-level system software that provides a hardware abstraction layer, disk and filesystem control, multi-tasking, load-balancing, networking and security enforcement. A kernel is not a complete operating system (as the term is usually understood). A complete system built around the Linux kernel is commonly known as the Linux operating system, although some prefer to call the system GNU/Linux and there is some controversy on the point. People often confuse the kernel with the operating system, leading to many mistaken notions, e.g. the idea that Torvalds wrote or coordinates other parts of the system than the kernel.
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 Aug 1991 - Linus posts to comp.os.minix: [2] (http://groups.google.com/groups?selm=1991Aug25.205708.9541%40klaava.Helsinki.FI&output=gplain)
- "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 (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(.
- [...] It's mostly in C, but most people wouldn't call what I write C. It uses every conceivable feature of the 386 I could find, as it was also a project to teach me about the 386. As already mentioned, it uses a MMU, for both paging (not to disk yet) and segmentation. It's the segmentation that makes it REALLY 386 dependent (every task has a 64Mb segment for code & data - max 64 tasks in 4Gb. Anybody who needs more than 64Mb/task - tough cookies). [...] Some of my "C"-files (specifically mm.c) are almost as much assembler as C. [...] Unlike minix, I also happen to LIKE interrupts, so interrupts are handled without trying to hide the reason behind them"
- Sep 1991 - Linux version 0.01 is released. (10,239 lines of code.)
- Oct 1991 - Linux version 0.02 is released. [3] (http://groups.google.com/groups?selm=1991Oct5.054106.4647%40klaava.Helsinki.FI&output=gplain)
- Dec 1991 - Linux 0.11 is released. This version is the first that is self-hosted. (that is: you can compile Linux 0.11 under Linux 0.11)
- 19 Jan 1992 - First post to alt.os.linux newsgroup. [4] (http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=1992Jan19.085628.18752%40cseg01.uark.edu)
- 31 Mar 1992 - The newsgroup comp.os.linux is created. [5] (http://groups.google.com/groups?selm=1992Mar31.131811.19832%40rock.concert.net&output=gplain)
- Apr 1992 - Linux version 0.96 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)
- 14 Mar 1994 - Linux 1.0.0 is released. (176,250 lines of code.)
- Mar 1995 - Linux 1.2.0 is released (310,950 lines of code.)
- 9 May 1996 - Tux the penguin, is suggested as mascot for Linux
- 9 Jun 1996 - Linux 2.0.0 is released. (777,956 lines of code.)
- 25 Jan 1999 - Linux 2.2.0 is released, very buggy at first. (1,800,847 lines of code.)
- 4 Jan 2001 - Linux 2.4.0 is released. (3,377,902 lines of code.)
- 18 Dec 2003 - Linux 2.6.0 is released. (5,929,913 lines of code.)
Versions
Torvalds has continued to release new versions of the kernel, consolidating contributions from other programmers and making changes of his own. All Linux releases with an even minor version number (the second component) are part of a stable series: 1.0.x, 1.2.x, 2.0.x, 2.2.x, 2.4.x and the current 2.6.x; releases with an odd minor version number, such as the 2.5.x series, are development versions not intended for production use. While Torvalds continues to release the latest development versions, the maintenance of the older "stable" versions is delegated to others, including David Weinehall (2.0), Alan Cox and later Marc-Christian Petersen (2.2), Marcelo Tosatti (2.4) and Andrew Morton (2.6). In addition to these "official" kernels, alternative "kernel trees" can be obtained from other sources. Distributors of complete operating systems typically maintain their own versions of the kernel, for example including drivers which have not yet been accepted into the official version.
Stable versions
- 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 (http://kniggit.net/wwol22.html)
- Version 2.4 of January 2001 added ISA Plug-and-Play, Hewlett-Packard's PA-RISC processor, USB and PC Card support. Support for Axis Communications' ETRAX CRIS ("Code Reduced Instruction Set") processors and the InterMezzo filesystem were added later. Wonderful World of Linux 2.4 (http://linuxtoday.com/news_story.php3?ltsn=2001-01-05-007-04-NW-LF-KN)
- Version 2.6 of December 17, 2003
- 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")
- OS support:
- support for SGI's XFS filesystem.
- 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 preemptible 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.
- A new "system filesystem" called sysfs.
- User Mode Linux integration.
- (and more changes: The Wonderful World of Linux 2.6 (http://www.kniggit.net/wwol26.html))
Architecture
The Linux kernel includes true multitasking, virtual memory, shared libraries, demand loading, shared copy-on-write executables, proper 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.
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. [6] (http://www.dina.dk/~abraham/Linus_vs_Tanenbaum.html) [7] (http://www.google.com/groups?threadm=12595%40star.cs.vu.nl)
The complete source code of various versions of the Linux kernel can be browsed at http://lxr.linux.no .
Portability
While not originally intended as a portable operating system, Linux is now one of the most widely ported operating system kernels (although NetBSD has been ported to almost as many architectures), running on a diverse range of systems from the iPAQ (a handheld computer) to the IBM S/390 (a massive, extremely expensive mainframe). Linux is intended to run as the main operating system on IBM's new Blue Gene supercomputer architecture when it is finished. Linus included, perhaps humorously, BogoMips into the kernel as a performance pseudo-comparison tool.
It is important to note that Linus's efforts were also directed successfully at a different sort of portability. Portability, according to Linus, 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 GPLed and other open source applications running.
Linux currently runs on the following machine architectures:
- ARM
- Axis Communications' CRIS
- Hewlett Packard's Alpha
- Hewlett Packard's PA-RISC
- Hitachi: SuperH (SEGA Dreamcast), H8/300
- IBM's S/390
- IBM's zSeries Mainframe
- 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;
- AMD64: AMD's 64-bit processor technology (formerly known as x86-64)
- 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 (http://elks.sourceforge.net) project)
- Microsoft's Xbox (Pentium III processor)
- Intel IA-64
- MIPS
- Silicon Graphics, Inc.
- Cobalt Qube, Cobalt Raq
- Sony PlayStation 2
- DECstation
- 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:
- 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
- several 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.
A complete list of ports is at Linux Ports (http://perso.wanadoo.es/xose/linux/linux_ports.html).
Installation
The source code for the Linux kernel can be downloaded from kernel.org (http://www.kernel.org/). To prepare a Version 2.6.x kernel for use, run these commands in order:
- make oldconfig to quickly parse a .config from a previous kernel version (if you do not have it, just skip this step).
- make config (or a more friendly version: make menuconfig - console, make xconfig - GUI - qt, or make gconfig - GUI - gtk+) to configure what features will be compiled into the kernel. A kernel can have support for very large systems or very small systems with a wide range of hardware. Including support for all of these may make the kernel take up more memory and run more slowly; if the kernel is being compiled for use on only one specific computer, support for features that computer does not have can be left out.
- make to compile all of the kernel components.
- make modules_install to copy the compiled modules to the proper place (usually under /lib/modules).
- make install to copy the kernel image itself to the proper place and update the boot loader (Lilo or GRUB) so that it can boot the new image.
Licensing terms
Initially, Torvalds released Linux under a license which forbade any commercial exploitation. This was soon changed to the GNU General Public License (version 2 exclusively). 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." [8] (http://www.hotwired.co.jp/matrix/9709/5_linus.html)
One general question about the application of the GPL to Linux involves 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 states that kernel modules ARE derivative "by default"; ultimately, such questions can only be resolved by a court.
Mascot
The Linux mascot is a penguin named Tux, created by Larry Ewing.
Many variants of the Tux penguin exist, with some in 3D.
The mascot is a penguin because as Torvalds put it, "Linus likes penguins. That's it." The name Tux was suggested to represent (T)orvalds (U)ni(X), and it stuck. [9] (http://www.sjbaker.org/tux/)
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 up to the panic.
References
- Torvalds, Linus; Diamond, David (2001). Just For Fun: The Story of an Accidental Revolutionary. HarperBusiness. ISBN 0066620724 (hardcover); HarperAudio ISBN 0694525391 (audio tape, abridged ed., read by David Diamond) - on the beginnings of the Linux kernel
- Revolution OS - a documentary on the history of Linux featuring several interviews with prominent hackers, including Torvalds
- LinkSys and binary modules (http://lwn.net/Articles/53780/), LWN.net Weekly Edition, October 16, 2003.
External links
Template:Wikibooks Template:Commons
- www.kernel.org - The Linux Kernel Archives, the official kernel repository (http://www.kernel.org/)
- Linux Kernel HowTo (http://tldp.org/HOWTO/Kernel-HOWTO/)
- Kernel Traffic, a summary of the high-traffic Linux kernel mailing list (http://www.kerneltraffic.org/index.html)
- KernelTrap (http://www.kerneltrap.org/)
- Linux Kernel Source Code Viewer (http://lxr.linux.no/source/)
- Linux Kernel Janitor (http://janitor.kernelnewbies.org/)
- Linux Device Drivers, 3rd Edition (http://lwn.net/Kernel/LDD3/)
- Understanding the Linux Kernel, 2nd Edition (http://www.oreilly.com/catalog/linuxkernel2/)
The following are to be merged
- http://web.archive.org/web/19990117070510/www.forbes.com/forbes/98/0810/6203094a.htm
- http://old.lwn.net/2001/features/Timeline/
- http://www.nd.edu/~ljordan/linux/tuxhistory.html
- http://www.linuxjournal.com/article.php?sid=6000
- https://netfiles.uiuc.edu/rhasan/linux
Linux 2.6
- Upgrade to 2.6 kernel (http://www.linux.org.uk/~davej/docs/post-halloween-2.6.txt)
- The Wonderful World of Linux 2.6 (http://kniggit.net/wwol26.html); Joseph Pranevich; December 2003
- Understanding the Linux 2.6.8.1 CPU Scheduler (http://josh.trancesoftware.com/linux/); Josh Aas, 17th February 2005
Pages with links to kernel resources
- Linux kernel @ dmoz.org (http://dmoz.org/Computers/Software/Operating_Systems/Linux/Kernel/)
- Linux kernel @ google (http://directory.google.com/Top/Computers/Software/Operating_Systems/Linux/Kernel/)
- http://www.linuxlinks.com/Kernel/
- http://www.topology.org/soft/lkernel.html
- http://loll.sourceforge.net/linux/links/Kernel/
- http://www.linux.org/dist/kernel.html
- Kernel Newbies.org (http://www.kernelnewbies.org/)
- Linux Kernel Developers' email list (http://vger.kernel.org/)de:Linux-Kernel
es:Linux (núcleo) fr:Noyau Linux it:Kernel Linux ja:Linuxカーネル lv:Linux nl:Linux-kernel no:Linux-kjernen nn:Linux-kjernen ru:Linux (ядро) sv:Linuxkärnan th:ลินุกซ์ เคอร์เนล vi:Hạt nhân Linux zh:Linux 内核