Main Page

encyclopedia.codeboy.net

 

Linux kernel

Tux, the Linux penguin
In computing, the 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 and assembly language. Developed under the GNU General Public License, the source code for Linux is freely available to everyone. It is the most famous example of free software and of open source development. Distributions of software based on this kernel are called Linux distributions.

Table of contents
1 History
2 Versions
3 Architecture
4 Portability
5 Kernel
6 Licensing terms
7 Mascot
8 Kernel panic
9 References
10 Resources

History

See also: Timeline of Linux development 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,\n   won't be big and professional like gnu) for\n   386(486) AT clones..." [1]
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 encumberances. 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,\ndisk 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.

Versions

\nTorvalds 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

\n*Version 1.0 of March 1994 supported only single-processor i386 machines.\n*Version 1.2 of March 1995 added support for Alpha, Sparc and Mips.\n*Version 2.0 of June 1996 added support for more processors and included
SMP support.\n*Version 2.2 of January 1999. The Wonderful World of Linux 2.2\n*Version 2.4 of January 2001 added ISA Plug-and-Play, 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
  • Version 2.6 of December 17, 2003\n**integrated uClinux (for microcontrollers, \n**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 and NEC's PC-9800, support for Intel's hyperthreading and PAE ("Physical Address Extension")\n**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)

Architecture

\nThe Linux kernel includes 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\nfamous flame war between Linus Torvalds and Andy Tanenbaum. [1] The complete source code of various versions of the Linux kernel can be browsed at http://lxr.linux.no .

Portability

\nWhile 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 even more different systems), running on systems as diverse as the iPAQ (a handheld computer) to the IBM S/390 (a massive, hugely expensive mainframe). Linux is intended to run as the main operating system on IBM's new Blue Gene supercomputer architecture when it is finished. 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:\n*ARM\n**Acorn: Archimedes, A5000 and RiscPC series \n**StrongARM, Intel XScale etc.\n**HP's iPAQ\n*Axis Communications' CRIS\n*Hewlett Packard's Alpha\n*Hewlett Packard's PA-RISC\n*Hitachi: SuperH (SEGA Dreamcast), H8/300\n*IA-64: PCs with 64-bit Intel Itanium\n*IBM's S/390\n*IBM's zSeries Mainframe\n*Intel 80386 and up: IBM PCs and compatibles with CPUs: \n**80386, 80486, and their AMD, Cyrix, TI and IBM variants\n** the entire Pentium series;\n** AMD 5x86, K5, K6, Athlon (all 32-bit versions), Duron; \n** AMD64: AMD's 64-bit processor technology (formerly known as x86-64)\n** Cyrix 5x86, 6x86 (M1), 6x86MX and MediaGX (National/AMD Geode) series.\n** VIA Technologies VIA C3 and later processors \n** Support for Intel 8086, 8088, 80186, 80188 and 80286 CPUs is under development (see ELKS project)\n**Microsoft's Xbox (Pentium III processor)\n*MIPS\n**Silicon Graphics, Inc machines, ...\n**Sony PlayStation 2\n*Motorola 68020 and up:\n** newer Amigas: A1200, A2500, A3000, A4000\n** Apple Macintosh II, LC, Quadra, Centris and early Performa series\n** Sun Microsystems 3-series workstations (experimental, uses Sun-3 MMU)\n** Non-Sun 68020-based machines require the Motorola 68851 PMMU\n*NEC v850e\n*PowerPC and IBM POWER: \n**most newer Apple computerss (all PCI-based Power Macintoshes, limited support for the older NuBus Power Macs)\n** clones of the PCI Power Mac marketed by Power Computing, UMAX and Motorola\n** Amigas upgraded with a "Power-UP" card (such as the Blizzard or CyberStorm)\n** IBM RS/6000, iSeries and pSeries systems\n** several embedded PowerPC platforms \n*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.

Kernel

The
source code for the Linux kernel can be downloaded from kernel.org. To prepare a kernel for use, run these commands in order:
  • make config 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 doesn't have can be left out. make menuconfig can also be used for a more friendly configuration program, or make xconfig for a graphical configuration program.\n* make to compile all of the kernel components.\n* make modules_install to copy the compiled modules to the proper place (usually under /lib/modules).\n* 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

\nInitially, 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." [1] 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

\nThe Linux mascot is a penguin named
Tux, created by Larry Ewing.

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/systm.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

\n* 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\n*
Revolution OS - a documentary on the history of Linux featuring several interviews with prominent hackers, including Torvalds\n* LinkSys and binary modules, LWN.net Weekly Edition, October 16, 2003.

Resources

\n*
www.kernel.org - The Linux Kernel Archives, the official kernel repository\n* Linux Kernel HowTo\n* Upgrade to 2.6 kernel\n* Kernel Traffic, a summary of the high-traffic Linux kernel mailing list\n*Linux kernel modules programming guide.\n*KernelTrap\n*Linux Kernel Source Code Viewer\n*Kernel Newbies\n

Pages with links to kernel resources

\n*
http://www.linuxlinks.com/Kernel/\n* http://www.topology.org/soft/lkernel.html\n* http://loll.sourceforge.net/linux/links/Kernel/\n* http://www.linux.org/dist/kernel.html\n* Kernel Newbies.org\n* Linux Kernel Developers' email list\n* The Linux FAQ Category:Linux\nCategory:Free software\nCategory:Operating system kernel

"Now, now my good man, this is no time for making enemies." - Voltaire (1694-1778) on his deathbed in response to a priest asking that he renounce Satan.