In computer science, the kernel is the central component of most computer operating systems (OS). An operating system (commonly abbreviated OS and O/S) is the software component of a Computer system that is responsible for the management and coordination Its responsibilities include managing the system's resources (the communication between hardware and software components). Typical PC hardware A typical Personal computer consists of a case or chassis in a tower shape (desktop and the following parts Motherboard [1] As a basic component of an operating system, a kernel provides the lowest-level abstraction layer for the resources (especially memory, processors and I/O devices) that application software must control to perform its function. This is about the concept in computer science for the concept in grouping see Principle of abstraction. In Computing, input/output, or I/O, refers to the communication between an Information processing system (such as a Computer) and the outside It typically makes these facilities available to application processes through inter-process communication mechanisms and system calls. Application software is a subclass of Computer software that employs the capabilities of a computer directly and thoroughly to a task that the user wishes to perform In computing a process is an instance of a Computer program that is being sequentially executed by a computer system that has the ability to run several computer Inter-Process Communication ( IPC) is a set of techniques for the exchange of data among two or more threads in one or more processes. In Computing, a system call is the mechanism used by an application program to request service from the Kernel.
These tasks are done differently by different kernels, depending on their design and implementation. While monolithic kernels will try to achieve these goals by executing all the code in the same address space to increase the performance of the system, microkernels run most of their services in user space, aiming to improve maintainability and modularity of the codebase. A monolithic kernel is a kernel architecture where the entire kernel is run in Kernel space in Supervisor mode. In Computing, an address space defines a range of discrete addresses each of which may correspond to a physical or virtual Memory register, a network host A microkernel is a minimal Computer Operating system kernel which in its purest form provides no operating-system services at all only the "kernel space" redirects here For mathematical definition see Null space. [2] A range of possibilities exists between these two extremes.
Contents |
On the definition of 'kernel' Jochen Liedtke said that the word is "traditionally used to denote the part of the operating system that is mandatory and common to all other software. Jochen Liedtke (1953 &ndash 10 June 2001) was a German Computer scientist, noted for his work on Microkernels especially the creation "[3]
Most operating systems rely on the kernel concept. The existence of a kernel is a natural consequence of designing a computer system as a series of abstraction layers,[4] each relying on the functions of layers beneath itself. This is about the concept in computer science for the concept in grouping see Principle of abstraction. The kernel, from this viewpoint, is simply the name given to the lowest level of abstraction that is implemented in software. In order to avoid having a kernel, one would have to design all the software on the system not to use abstraction layers; this would increase the complexity of the design to such a point that only the simplest systems could feasibly be implemented.
While it is today mostly called the kernel, the same part of the operating system has also in the past been known as the nucleus or core. [5][6][1][7] (Note, however, that the term core has also been used to refer to the primary memory of a computer system, because some early computers used a form of memory called core memory. Magnetic core memory, or ferrite-core memory, is an early form of Random access Computer memory. )
In most cases, the boot loader starts executing the kernel in supervisor mode,[8] The kernel then initializes itself and starts the first process. In Computing, booting ( booting up) is a bootstrapping process that starts Operating systems when the user turns on a Computer system After this, the kernel does not typically execute directly, only in response to external events (e. g. via system calls used by applications to request services from the kernel, or via interrupts used by the hardware to notify the kernel of events). In Computing, an interrupt is an asynchronous signal from hardware indicating the need for attention or a synchronous event in software indicating the need for a change Additionally, the kernel typically provides a loop that is executed whenever no processes are available to run; this is often called the idle process.
Kernel development is considered one of the most complex and difficult tasks in programming. [9] Its central position in an operating system implies the necessity for good performance, which defines the kernel as a critical piece of software and makes its correct design and implementation difficult. For various reasons, a kernel might not even be able to use the abstraction mechanisms it provides to other software. In Computer science, abstraction is a mechanism and practice to reduce and factor out details so that one can focus on a few concepts at a time Such reasons include memory management concerns (for example, a user-mode function might rely on memory being subject to demand paging, but as the kernel itself provides that facility it cannot use it, because then it might not remain in memory to provide that facility) and lack of reentrancy, thus making its development even more difficult for software engineers. Memory management is the act of managing Computer memory. In its simpler forms this involves providing ways to allocate portions of memory to programs at their request In Computer Operating systems, demand paging is an application of Virtual memory.
A kernel will usually provide features for low-level scheduling[10] of processes (dispatching), inter-process communication, process synchronization, context switching, manipulation of process control blocks, interrupt handling, process creation and destruction, and process suspension and resumption (see process states). Dispatch is a procedure for assigning employees (workers or vehicles to customers Inter-Process Communication ( IPC) is a set of techniques for the exchange of data among two or more threads in one or more processes. In Computer science, synchronization refers to one of two distinct but related concepts synchronization of processes, and synchronization of data A context switch is the Computing process of storing and restoring the state ( context) of a CPU such that multiple processes can share A Process Control Block (PCB also called Task Control Block or Task Struct is a data structure in the Operating system kernel containing the information needed to In Computing, an interrupt is an asynchronous signal from hardware indicating the need for attention or a synchronous event in software indicating the need for a change In a multitasking Computer system processes may occupy a variety of states. [5][7]
The kernel's primary purpose is to manage the computer's resources and allow other programs to run and use these resources. [1] Typically, the resources consist of:
Key aspects necessary in resource managements are the definition of an execution domain (address space) and the protection mechanism used to mediate the accesses to the resources within a domain. In Computing, an address space defines a range of discrete addresses each of which may correspond to a physical or virtual Memory register, a network host [1]
Kernels also usually provide methods for synchronization and communication between processes (called inter-process communication or IPC). In Computer science, synchronization refers to one of two distinct but related concepts synchronization of processes, and synchronization of data Inter-Process Communication ( IPC) is a set of techniques for the exchange of data among two or more threads in one or more processes.
A kernel may implement these features itself, or rely on some of the processes it runs to provide the facilities to other processes, although in this case it must provide some means of IPC to allow processes to access the facilities provided by each other.
Finally, a kernel must provide running programs with a method to make requests to access these facilities.
The main task of a kernel is to allow the execution of applications and support them with features such as hardware abstractions. A process defines which memory portions the application can access. [11] (For this introduction, process, application and program are used as synonyms. ) Kernel process management must take into account the hardware built-in equipment for memory protection. Process management is the ensemble of activities of planning and monitoring the performance of a Process, especially in the sense of Business process, often confused Memory protection is a way to control memory usage on a computer and is core to virtually every Operating system. [12]
To run an application, a kernel typically sets up an address space for the application, loads the file containing the application's code into memory (perhaps via demand paging), sets up a stack for the program and branches to a given location inside the program, thus starting its execution. In Computing, an address space defines a range of discrete addresses each of which may correspond to a physical or virtual Memory register, a network host In Computer Operating systems, demand paging is an application of Virtual memory. In Computer science, a call stack is a dynamic stack data structure which stores information about the active Subroutines of a Computer program [13]
Multi-tasking kernels are able to give the user the illusion that the number of processes being run simultaneously on the computer is higher than the maximum number of processes the computer is physically able to run simultaneously. In computing Multitasking is a method by which multiple tasks also known as processes, share common processing resources such as a CPU. Typically, the number of processes a system may run simultaneously is equal to the number of CPUs installed (however this may not be the case if the processors support simultaneous multithreading). Simultaneous multithreading, often abbreviated as SMT, is a technique for improving the overall efficiency of Superscalar CPUs with Hardware
In a pre-emptive multitasking system, the kernel will give every program a slice of time and switch from process to process so quickly that it will appear to the user as if these processes were being executed simultaneously. Pre-emption or preemption in Computing is the act of temporarily interrupting a task being carried out by a computer system, without requiring The kernel uses scheduling algorithms to determine which process is running next and how much time it will be given. In Computer science, a scheduling algorithm is the method by which threads, processes or data flows are given access to system resources (e The algorithm chosen may allow for some processes to have higher priority than others. The kernel generally also provides these processes a way to communicate; this is known as inter-process communication (IPC) and the main approaches are shared memory, message passing and remote procedure calls (see concurrent computing). Inter-Process Communication ( IPC) is a set of techniques for the exchange of data among two or more threads in one or more processes. In Computing, shared memory is a memory that may be simultaneously accessed by multiple programs with an intent to provide communication among them or avoid redundant copies In Computer science, message passing is a form of communication used in Parallel computing, Object-oriented programming, and Interprocess communication Remote procedure call ( RPC) is an Inter-process communication technology that allows a Computer program to cause a Subroutine or procedure to Concurrent computing is the concurrent (simultaneous execution of multiple interacting computational tasks
Other systems (particularly on smaller, less powerful computers) may provide co-operative multitasking, where each process is allowed to run uninterrupted until it makes a special request that tells the kernel it may switch to another process. In computing Multitasking is a method by which multiple tasks also known as processes, share common processing resources such as a CPU. Such requests are known as "yielding", and typically occur in response to requests for interprocess communication, or for waiting for an event to occur. Older versions of Windows and Mac OS both used co-operative multitasking but switched to pre-emptive schemes as the power of the computers to which they were targeted grew. Microsoft Windows is a series of Software Operating systems and Graphical user interfaces produced by Microsoft. Mac OS is the trademarked name for a series of Graphical user interface -based Operating systems developed by Apple Inc
The operating system might also support multiprocessing (SMP or Non-Uniform Memory Access); in that case, different programs and threads may run on different processors. Multiprocessing is the use of two or more central processing units (CPUs within a single computer system In Computing, symmetric multiprocessing or SMP involves a Multiprocessor computer-architecture where two or more identical processors can connect to a single Non-Uniform Memory Access or Non-Uniform Memory Architecture ( NUMA) is a computer memory design used in Multiprocessors where the memory access A kernel for such a system must be designed to be re-entrant, meaning that it may safely run two different parts of its code simultaneously. This typically means providing synchronization mechanisms (such as spinlocks) to ensure that no two processors attempt to modify the same data at the same time. In Computer science, synchronization refers to one of two distinct but related concepts synchronization of processes, and synchronization of data In Software engineering, a spinlock is a lock where the thread simply waits in a loop ("spins" repeatedly checking until the lock becomes available
The kernel has full access to the system's memory and must allow processes to access safely this memory as they require it. Often the first step in doing this is virtual addressing, usually achieved by paging and/or segmentation. Virtual memory is a Computer system technique which gives an application program the impression that it has contiguous working memory while in fact it may be physically In Computer Operating systems that have their Main memory divided into pages, paging (sometimes called swapping) is a transfer In computing memory segmentation is one of the most common ways to achieve Memory protection; another common one is Paging. Virtual addressing allows the kernel to make a given physical address appear to be another address, the virtual address. Virtual address spaces may be different for different processes; the memory that one process accesses at a particular (virtual) address may be different memory from what another process accesses at the same address. This allows every program to behave as if it is the only one (apart from the kernel) running and thus prevents applications from crashing each other. [13]
On many systems, a program's virtual address may refer to data which is not currently in memory. The layer of indirection provided by virtual addressing allows the operating system to use other data stores, like a hard drive, to store what would otherwise have to remain in main memory (RAM). A hard disk drive ( HDD) commonly referred to as a hard drive, hard disk, or fixed disk drive, is a Non-volatile storage device As a result, operating systems can allow programs to use more memory than the system has physically available. When a program needs data which is not currently in RAM, the CPU signals to the kernel that this has happened, and the kernel responds by writing the contents of an inactive memory block to disk (if necessary) and replacing it with the data requested by the program. The program can then be resumed from the point where it was stopped. This scheme is generally known as demand paging. In Computer Operating systems, demand paging is an application of Virtual memory.
Virtual addressing also allows creation of virtual partitions of memory in two disjointed areas, one being reserved for the kernel (kernel space) and the other for the applications (user space). "kernel space" redirects here For mathematical definition see Null space. "kernel space" redirects here For mathematical definition see Null space. The applications are not permitted by the processor to address kernel memory, thus preventing an application from damaging the running kernel. This fundamental partition of memory space has contributed much to current designs of actual general-purpose kernels and is almost universal in such systems, although some research kernels (e. g. Singularity) take other approaches. Singularity is an experimental Operating system being built by Microsoft Research since 2003
To perform useful functions, processes need access to the peripherals connected to the computer, which are controlled by the kernel through device drivers. For an account of the words periphery and peripheral as they are used in biology sociology politics computer hardware and other fields see the In computing a device driver or software driver is a Computer program allowing higher-level computer programs to interact with a Hardware device For example, to show the user something on the screen, an application would make a request to the kernel, which would forward the request to its display driver, which is then responsible for actually plotting the character/pixel. [13]
A kernel must maintain a list of available devices. This list may be known in advance (e. g. on an embedded system where the kernel will be rewritten if the available hardware changes), configured by the user (typical on older PCs and on systems that are not designed for personal use) or detected by the operating system at run time (normally called plug and play). Plug-and-play is a computer feature that allows the addition of a new device normally a Peripheral, without requiring reconfiguration or manual installation of Device
In a plug and play system, a device manager first performs a scan on different hardware buses, such as Peripheral Component Interconnect (PCI) or Universal Serial Bus (USB), to detect installed devices, then searches for the appropriate drivers
As device management is a very OS-specific topic, these drivers are handled differently by each kind of kernel design, but in every case, the kernel has to provide the I/O to allow drivers to physically access their devices through some port or memory location. In Computer architecture, a bus is a subsystem that transfers data between computer components inside a Computer or between computers The Peripheral Component Interconnect, or PCI Standard (commonly PCI) specifies a Computer bus for attaching peripheral devices to a Computer In Computing, input/output, or I/O, refers to the communication between an Information processing system (such as a Computer) and the outside Very important decisions have to be made when designing the device management system, as in some designs accesses may involve context switches, making the operation very CPU-intensive and easily causing a significant performance overhead. A context switch is the Computing process of storing and restoring the state ( context) of a CPU such that multiple processes can share
To actually perform useful work, a process must be able to access the services provided by the kernel. This is implemented differently by each kernel, but most provide a C library or an API, which in turn invokes the related kernel functions. The C standard library (also known as libc) is a now-standardized collection of Header files and library routines used to implement common operations such [14]
The method of invoking the kernel function varies from kernel to kernel. If memory isolation is in use, it is impossible for a user process to call the kernel directly, because that would be a violation of the processor's access control rules. A few possibilities are:
An important consideration in the design of a kernel is the support it provides for protection from faults (fault tolerance) and from malicious behaviors (security). In Engineering, Fault-tolerant design, also known as fail-safe design, is a design that enables a system to continue operation possibly at a reduced level (also known This article describes how security can be achieved through design and engineering These two aspects are usually not clearly distinguished, and the adoption of this distinction in the kernel design leads to the rejection of a hierarchical structure for protection. In Computer sciences the separation of protection and security is a design choice [1]
The mechanisms or policies provided by the kernel can be classified according to several criteria, as: static (enforced at compile time) or dynamic (enforced at runtime); preemptive or post-detection; according to the protection principles they satisfy (i. In Computer science, compile time refers to either the operations performed by a Compiler (the "compile-time operations" or Programming language In Computer science, runtime or run time describes the operation of a Computer program, the duration of its execution from beginning to termination e. Denning[15][16]); whether they are hardware supported or language based; whether they are more an open mechanism or a binding policy; and many more.
A useful measure of the level of fault tolerance of a system is how closely it adheres to the principle of least privilege. In Information security, Computer science, and other fields the principle of least privilege, also known as the principle of minimal privilege or just [17] In cases where multiple programs are running on a single computer, it is important to prevent a fault in one of the programs from negatively affecting the other. Extended to malicious design rather than a fault, this also applies to security, where it is necessary to prevent processes from accessing information without being granted permission. This article describes how security can be achieved through design and engineering
The two major hardware approaches[18] for protection (of sensitive information) are Hierarchical protection domains (also called ring architectures, segment architectures or supervisor mode),[19] and Capability-based addressing. In Computer science, capability-based addressing is a scheme used by some computers to control access to memory [20]
Hierarchical protection domains are much less flexible, as is the case with every kernel with a hierarchical structure assumed as global design criterion. [1] In the case of protection it is not possible to assign different privileges to processes that are at the same privileged level, and therefore is not possible to satisfy Denning's four principles for fault tolerance[15][16] (particularly the Principle of least privilege). Peter J Denning is a noted American Computer scientist. He is best known for inventing the working-set model for program behavior which defeated Hierarchical protection domains also have a major performance drawback, since interaction between different levels of protection, when a process has to manipulate a data structure both in 'user mode' and 'supervisor mode', always requires message copying (transmission by value). In Computer science, an evaluation strategy is a set of (usually deterministic rules for determining the evaluation of expressions in a Programming language [21] A kernel based on capabilities, however, is more flexible in assigning privileges, can satisfy Denning's fault tolerance principles,[22] and typically doesn't suffer from the performance issues of copy by value.
Both approaches typically require some hardware or firmware support to be operable and efficient. The hardware support for hierarchical protection domains[23] is typically that of "CPU modes. CPU modes (also called processor modes or CPU privilege levels and by other names are operating modes for the Central processing unit of some " An efficient and simple way to provide hardware support of capabilities is to delegate the MMU the responsibility of checking access-rights for every memory access, a mechanism called capability-based addressing. A memory management unit ( MMU) sometimes called paged memory management unit ( PMMU) is a Computer hardware component responsible for handling In Computer science, capability-based addressing is a scheme used by some computers to control access to memory [22] Most commercial computer architectures lack MMU support for capabilities. An alternative approach is to simulate capabilities using commonly-support hierarchical domains; in this approach, each protected object must reside in an address space that the application does not have access to; the kernel also maintains a list of capabilities in such memory. When an application needs to access an object protected by a capability, it performs a system call and the kernel performs the access for it. The performance cost of address space switching limits the practicality of this approach in systems with complex interactions between objects, but it is used in current operating systems for objects that are not accessed frequently or which are not expected to perform quickly. [24][25] Approaches where protection mechanism are not firmware supported but are instead simulated at higher levels (e. g. simulating capabilities by manipulating page tables on hardware that does not have direct support), are possible, but there are performance implications. [26] Lack of hardware support may not be an issue, however, for systems that choose to use language-based protection. [27]
An important kernel design decision is the choice of the abstraction levels where the security mechanisms and policies should be implemented. Kernel security mechanisms play a critical role in supporting security at higher levels. [28][29][30][31][32][22]
One approach is to use firmware and kernel support for fault tolerance (see above), and build the security policy for malicious behavior on top of that (adding features such as cryptography mechanisms where necessary), delegating some responsibility to the compiler. Cryptography (or cryptology; from Greek grc κρυπτός kryptos, "hidden secret" and grc γράφω gráphō, "I write" A compiler is a Computer program (or set of programs that translates text written in a computer language (the source language) into another Approaches that delegate enforcement of security policy to the compiler and/or the application level are often called language-based security.
The lack of many critical security mechanisms in current mainstream operating systems impedes the implementation of adequate security policies at the application abstraction level. This is about the concept in computer science for the concept in grouping see Principle of abstraction. [28] In fact, a common misconception in computer security is that any security policy can be implemented in an application regardless of kernel support. [28]
Typical computer systems today use hardware-enforced rules about what programs are allowed to access what data. The processor monitors the execution and stops a program that violates a rule (e. g. , a user process that is about to read or write to kernel memory, and so on). In systems that lack support for capabilities, processes are isolated from each other by using separate address spaces. [33] Calls from user processes into the kernel are regulated by requiring them to use one of the above-described system call methods.
An alternative approach is to use language-based protection. In a language-based protection system, the kernel will only allow code to execute that has been produced by a trusted language compiler. In a language-based system, the Operating system has both the kernel and applications implemented using a high level Programming language, such A compiler is a Computer program (or set of programs that translates text written in a computer language (the source language) into another The language may then be designed such that it is impossible for the programmer to instruct it to do something that will violate a security requirement. [27]
Advantages of this approach include:
Disadvantages include:
Examples of systems with language-based protection include JX and Microsoft's Singularity. JX is a Microkernel Operating system with both the kernel and applications implemented using the Java Programming language. Microsoft Corporation is an American multinational Computer technology Corporation, which rose to dominate the Home computer Singularity is an experimental Operating system being built by Microsoft Research since 2003
Edsger Dijkstra proved that from a logical point of view, atomic lock and unlock operations operating on binary semaphores are sufficient primitives to express any functionality of process cooperation. Edsger Wybe Dijkstra ( May 11, 1930 &ndash August 6, 2002; ˈɛtsxər ˈwibə ˈdɛɪkstra was a Dutch computer scientist In Computer science, a lock is a synchronization mechanism for enforcing limits on access to a resource in an environment where there are many threads of For other uses see Semaphore. A semaphore, in computer science is a protected Variable (an entity storing a value or Abstract [34] However this approach is generally held to be lacking in terms of safety and efficiency, whereas a message passing approach is more flexible. In Computer science, message passing is a form of communication used in Parallel computing, Object-oriented programming, and Interprocess communication [7]
The idea of a kernel where I/O devices are handled uniformly with other processes, as parallel co-operating processes, was first proposed and implemented by Brinch Hansen (although similar ideas were suggested in 1967[35][36]). Per Brinch Hansen (November 13 1938 - July 31 2007 was a Danish-American Computer scientist known for Concurrent programming theory In Hansen's description of this, the "common" processes are called internal processes, while the I/O devices are called external processes. [7]
Naturally, the above listed tasks and features can be provided in many ways that differ from each other in design and implementation.
The principle of separation of mechanism and policy is the substantial difference between the philosophy of micro and monolithic kernels. The Separation of mechanism and Policy is a fundamental design principle in the field of Computer science. [37][38] Here a mechanism is the support that allows the implementation of many different policies, while a policy is a particular "mode of operation". In minimal microkernel just some very basic policies are included,[38] and its mechanisms allows what is running on top of the kernel (the remaining part of the operating system and the other applications) to decide which policies to adopt (as memory management, high level process scheduling, file system management, etc. ). [1][7] A monolithic kernel instead tends to include many policies, therefore restricting the rest of the system to rely on them.
Per Brinch Hansen presented cogent arguments in favor of separation of mechanism and policy. Per Brinch Hansen (November 13 1938 - July 31 2007 was a Danish-American Computer scientist known for Concurrent programming theory An argument is cogent if and only if the truth of the argument's premises would render the truth of the conclusion probable (i [1][7] The failure to properly fulfill this separation, is one of the major causes of the lack of substantial innovation in existing operating systems,[1] a problem common in computer architecture. [39][40][41] The monolithic design is induced by the "kernel mode"/"user mode" architectural approach to protection (technically called hierarchical protection domains), which is common in conventional commercial system;[42] in fact, every module needing protection is therefore preferably included into the kernel. [42] This link between monolithic design and "privileged mode" can be reconducted to the key issue of mechanism-policy separation;[1] in fact the "privileged mode" architectural approach melts together the protection mechanism with the security policies, while the major alternative architectural approach, capability-based addressing, clearly distinguishes between the two, leading naturally to a microkernel design[1] (see Separation of protection and security). In Computer science, capability-based addressing is a scheme used by some computers to control access to memory In Computer sciences the separation of protection and security is a design choice
While monolithic kernels execute all of their code in the same address space (kernel space) microkernels try to run most of their services in user space, aiming to improve maintainability and modularity of the codebase. A monolithic kernel is a kernel architecture where the entire kernel is run in Kernel space in Supervisor mode. "kernel space" redirects here For mathematical definition see Null space. A microkernel is a minimal Computer Operating system kernel which in its purest form provides no operating-system services at all only the [2] Most kernels do not fit exactly into one of these categories, but are rather found in between these two designs. These are called hybrid kernels. Hybrid kernel is a kernel architecture based on combining aspects of Microkernel and Monolithic kernel architectures used in Computer More exotic designs such as nanokernels and exokernels are available, but are seldom used for production systems. Exokernel is an Operating system kernel developed by the MIT Parallel and Distributed Operating Systems group and also a class of similar operating systems The Xen hypervisor, for example, is an exokernel. Xen is a virtual machine monitor for IA-32, X86, X86-64, IA-64 and PowerPC 970 architectures

In a monolithic kernel, all OS services run along with the main kernel thread, thus also residing in the same memory area. A monolithic kernel is a kernel architecture where the entire kernel is run in Kernel space in Supervisor mode. This approach provides rich and powerful hardware access. Some developers, such as UNIX developer Ken Thompson, maintain that monolithic systems are easier to design and implement than other solutions. The main disadvantages of monolithic kernels are the dependencies between system components - a bug in a device driver might crash the entire system - and the fact that large kernels can become very difficult to maintain.
The microkernel approach consists of defining a simple abstraction over the hardware, with a set of primitives or system calls to implement minimal OS services such as memory management, multitasking, and inter-process communication. In Computing, a system call is the mechanism used by an application program to request service from the Kernel. Memory management is the act of managing Computer memory. In its simpler forms this involves providing ways to allocate portions of memory to programs at their request In computing Multitasking is a method by which multiple tasks also known as processes, share common processing resources such as a CPU. Inter-Process Communication ( IPC) is a set of techniques for the exchange of data among two or more threads in one or more processes. Other services, including those normally provided by the kernel such as networking, are implemented in user-space programs, referred to as servers. Computer networking is the Engineering Discipline concerned with communication between Computer systems or devices Networking routers Microkernels are easier to maintain than monolithic kernels, but the large number of system calls and context switches might slow down the system because they typically generate more overhead than plain function calls. A context switch is the Computing process of storing and restoring the state ( context) of a CPU such that multiple processes can share
A microkernel allows the implementation of the remaining part of the operating system as a normal application program written in a high-level language, and the use of different operating systems on top of the same unchanged kernel. In computing a high-level programming language is a Programming language with strong abstraction from the details of the computer [7] It is also possible to dynamically switch among operating systems and to have more than one active simultaneously. [7]
As the computer kernel grows, a number of problems become evident. One of the most obvious is that the memory footprint increases. Memory footprint refers to the amount of main memory that a program uses or references while running This is mitigated to some degree by perfecting the virtual memory system, but not all computer architectures have virtual memory support. Virtual memory is a Computer system technique which gives an application program the impression that it has contiguous working memory while in fact it may be physically In Computer engineering, computer architecture is the conceptual design and fundamental operational structure of a Computer system [43] To reduce the kernel's footprint, extensive editing has to be performed to carefully remove unneeded code, which can be very difficult with non-obvious interdependencies between parts of a kernel with millions of lines of code.
Due to the problems that monolithic kernels pose, they were considered obsolete by the early 1990s. As a result, the design of Linux as a monolithic kernel rather than a microkernel was the topic of a famous flame war between Linus Torvalds and Andrew Tanenbaum. Linux (commonly pronounced ˈlɪnəks Flaming is the hostile and insulting interaction between Internet users Linus Benedict Torvalds ( ˈtuːrvalds born December 28 1969 in Helsinki, Finland) is a Finnish software engineer Andrew Stuart "Andy" Tanenbaum (sometimes referred to by the handle ast) (born 1944 is a Professor of Computer science at the Vrije [44] There is merit on both sides of the argument presented in the Tanenbaum/Torvalds debate. The Tanenbaum-Torvalds debate is a debate between Andrew S Tanenbaum and Linus Torvalds, regarding Linux and kernel architecture in general
Some, including early UNIX developer Ken Thompson, argued that while microkernel designs were more aesthetically appealing, monolithic kernels were easier to implement. Kenneth Lane Thompson (born February 4 1943) commonly referred to as Ken Thompson (or simply However, a bug in a monolithic system usually crashes the entire system, while this doesn't happen in a microkernel with servers running apart from the main thread. Monolithic kernel proponents reason that incorrect code doesn't belong in a kernel, and that microkernels offer little advantage over correct code. Microkernels are often used in embedded robotic or medical computers where crash tolerance is important and most of the OS components reside in their own private, protected memory space. This is impossible with monolithic kernels, even with modern module-loading ones.
Monolithic kernels are designed to have all of their code in the same address space (kernel space) to increase the performance of the system. A monolithic kernel is a kernel architecture where the entire kernel is run in Kernel space in Supervisor mode. "kernel space" redirects here For mathematical definition see Null space. Some developers, as UNIX developer Ken Thompson, maintain that monolithic systems are extremely efficient if well-written. The monolithic model tends to be more efficient through the use of shared kernel memory, rather than the slower IPC system of microkernel designs, which is typically based on message passing. In Computer science, message passing is a form of communication used in Parallel computing, Object-oriented programming, and Interprocess communication
The performance of microkernels constructed in the 1980's and early 1990's was poor. [3][45] Studies that empirically measured the performance of these microkernels did not analyze the reasons of such inefficiency. [3] The explanations of this data were left to "folklore", with the assumption that they were due to the increased frequency of switches from "kernel-mode" to "user-mode"[3] , to the increased frequency of inter-process communication [3] and to the increased frequency of context switches. Inter-Process Communication ( IPC) is a set of techniques for the exchange of data among two or more threads in one or more processes. A context switch is the Computing process of storing and restoring the state ( context) of a CPU such that multiple processes can share [3]
In fact, as guessed in 1995, the reasons for those poor performance might as well have been: (1) an actual inefficiency of the whole microkernel approach, (2) the particular concepts implemented in those microkernels, and (3) the particular implementation of those concepts. [3] Therefore it remained to be studied if the solution to build an efficient microkernel was, unlike previous attempts, to apply the correct construction techniques. [3]
On the other end, the hierarchical protection domains architecture that leads to the design of a monolithic kernel,[42] has a significant performance drawback each time there's an interaction between different levels of protection (i. e. when a process has to manipulate a data structure both in 'user mode' and 'supervisor mode'), since this requires message copying by value. In Computer science, an evaluation strategy is a set of (usually deterministic rules for determining the evaluation of expressions in a Programming language [21]
By the mid-1990s, most researchers had abandoned the belief that careful tuning could reduce this overhead dramatically, but recently, newer microkernels, optimized for performance, such as L4[46] and K42 have addressed these problems. L4 is a family of second-generation Microkernels based on theoriginal designs and implementations by German Computer scientist Jochen Liedtke. K42 is an Open-source research Operating system for cache-coherent 64-bit multiprocessor systems
Hybrid kernels are essentially a compromise between the monolithic kernel approach and the microkernel system. This implies running some services (such as the network stack or the filesystem) in kernel space to reduce the performance overhead of a traditional microkernel, but still running kernel code (such as device drivers) as servers in user space. A protocol stack (sometimes communications stack) is a particular software implementation of a Computer networking protocol suite In Computing, a file system (often also written as filesystem) is a method for storing and organizing Computer files and the data they contain to make
A nanokernel delegates virtually all services — including even the most basic ones like interrupt controllers or the timer — to device drivers to make the kernel memory requirement even smaller than a traditional microkernel. A Programmable Interrupt Controller ( PIC) is a device which allows priority levels to be assigned to its interrupt outputs A timer is a specialized type of Clock. A timer can be used to control the sequence of an event or process In computing a device driver or software driver is a Computer program allowing higher-level computer programs to interact with a Hardware device [47]
An exokernel is a type of kernel that does not abstract hardware into theoretical models. Exokernel is an Operating system kernel developed by the MIT Parallel and Distributed Operating Systems group and also a class of similar operating systems Instead it allocates physical hardware resources, such as processor time, memory pages, and disk blocks, to different programs. A program running on an exokernel can link to a library operating system that uses the exokernel to simulate the abstractions of a well-known OS, or it can develop application-specific abstractions for better performance. [48]
Strictly speaking, an operating system (and thus, a kernel) is not required to run a computer. The history of computer Operating systems recapitulates to a degree the recent History of computer hardware. Programs can be directly loaded and executed on the "bare metal" machine, provided that the authors of those programs are willing to work without any hardware abstraction or operating system support. Most early computers operated this way during the 1950s and early 1960s, which were reset and reloaded between the execution of different programs. Eventually, small ancillary programs such as program loaders and debuggers were left in memory between runs, or loaded from ROM. In Computing, a loader is the part of an operating system that is responsible for loading programs from executables (i A debugger is a Computer program that is used to test and Debug other programs As these were developed, they formed the basis of what became early operating system kernels. The "bare metal" approach is still used today on some video game consoles and embedded systems, but in general, newer computers use modern operating systems and kernels. An embedded system is a special-purpose Computer system designed to perform one or a few dedicated functions often with Real-time computing constraints
In 1969 the RC 4000 Multiprogramming System introduced the system design philosophy of a small nucleus "upon which operating systems for different purposes could be built in an orderly manner",[49] what would be called the microkernel approach. The RC 4000 Multiprogramming System was an Operating system developed for the RC 4000 Minicomputer in 1969
In the decade preceding Unix, computers had grown enormously in power - to the point where computer operators were looking for new ways to get people to use the spare time on their machines. Time-sharing refers to sharing a computing resource among many users by multitasking. Unix (officially trademarked as UNIX, sometimes also written as Unix with Small caps) is a computer One of the major developments during this era was time-sharing, whereby a number of users would get small slices of computer time, at a rate at which it appeared they were each connected to their own, slower, machine. Time-sharing refers to sharing a computing resource among many users by multitasking. [50]
The development of time-sharing systems led to a number of problems. One was that users, particularly at universities where the systems were being developed, seemed to want to hack the system to get more CPU time. For this reason, security and access control became a major focus of the Multics project in 1965. This article describes how security can be achieved through design and engineering Access control is the ability to permit or deny the use of a particular resource by a particular entity Multics ( Mult iplexed I nformation and C omputing S ervice was an extremely influential early Time-sharing Operating system [51] Another ongoing issue was properly handling computing resources: users spent most of their time staring at the screen instead of actually using the resources of the computer, and a time-sharing system should give the CPU time to an active user during these periods. Finally, the systems typically offered a memory hierarchy several layers deep, and partitioning this expensive resource led to major developments in virtual memory systems. The Hierarchical arrangement of storage in current Computer architectures is called the memory hierarchy. Virtual memory is a Computer system technique which gives an application program the impression that it has contiguous working memory while in fact it may be physically
Unix represented the culmination of decades of development towards a modern operating system. Unix (officially trademarked as UNIX, sometimes also written as Unix with Small caps) is a computer During the design phase, programmers decided to model every high-level device as a file, because they believed the purpose of computation was data transformation. [52] For instance, printers were represented as a "file" at a known location — when data was copied to the file, it printed out. Other systems, to provide a similar functionality, tended to virtualize devices at a lower level — that is, both devices and files would be instances of some lower level concept. Virtualizing the system at the file level allowed users to manipulate the entire system using their existing file management utilities and concepts, dramatically simplifying operation. As an extension of the same paradigm, Unix allows programmers to manipulate files using a series of small programs, using the concept of pipes, which allowed users to complete operations in stages, feeding a file through a chain of single-purpose tools. In Unix-like computer Operating systems a pipeline is the original software pipeline: a set of processes chained by their Standard Although the end result was the same, using smaller programs in this way dramatically increased flexibility as well as ease of development and use, allowing the user to modify their workflow by adding or removing a program from the chain.
In the Unix model, the Operating System consists of two parts; one the huge collection of utility programs that drive most operations, the other the kernel that runs the programs. [52] Under Unix, from a programming standpoint, the distinction between the two is fairly thin; the kernel is a program running in supervisor mode[8] that acts as a program loader and supervisor for the small utility programs making up the rest of the system, and to provide locking and I/O services for these programs; beyond that, the kernel didn't intervene at all in user space. In Computer science, a lock is a synchronization mechanism for enforcing limits on access to a resource in an environment where there are many threads of In Computing, input/output, or I/O, refers to the communication between an Information processing system (such as a Computer) and the outside "kernel space" redirects here For mathematical definition see Null space.
Over the years the computing model changed, and Unix's treatment of everything as a file no longer seemed to be as universally applicable as it was before. Although a terminal could be treated as a file or a stream, which is printed to or read from, the same did not seem to be true for a graphical user interface. A computer terminal is an electronic or electromechanical hardware device that is used for entering data into and displaying data from a Computer or a Computing Networking posed another problem. Computer networking is the Engineering Discipline concerned with communication between Computer systems or devices Networking routers Even if network communication can be compared to file access, the low-level packet-oriented architecture dealt with discrete chunks of data and not with whole files. As the capability of computers grew, Unix became increasingly cluttered with code. While kernels might have had 100,000 lines of code in the seventies and eighties, kernels of modern Unix successors like Linux have more than 4. Source lines of code ( SLOC) is a Software metric used to measure the size of a software program by counting the number of lines in the text of the program's Linux is an operating system kernel used by a family of Unix-like Operating systems These are popularly termed Linux operating systems and 5 million lines. [53] Thus, the biggest problem with monolithic kernels, or monokernels, was sheer size. The code was so extensive that working on such a large codebase was extremely tedious and time-consuming.
Modern Unix-derivatives are generally based on module-loading monolithic kernels. Examples for this are Linux distributions as well as Berkeley software distribution variants such as FreeBSD and NetBSD. A Linux distribution (also called GNU/Linux by distributions such as Debian, Fedora, Ubuntu, Linux Mint, Mandriva and FreeBSD is a Unix-like free Operating system descended from AT&T UNIX via the Berkeley Software Distribution (BSD branch through NetBSD is a freely redistributable Open source version of the Unix -derivative Berkeley Software Distribution (BSD Computer Operating Apart from these alternatives, amateur developers maintain an active operating system development community, populated by self-written hobby kernels which mostly end up sharing many features with Linux and/or being compatible with it. Operating system development refers to the development of Operating systems, and it is often abbreviated to OSDev. [54]
Apple Computer first launched Mac OS in 1984, bundled with its Apple Macintosh personal computer. On January 24, 1984, Apple Computer Inc (now Apple Inc) introduced the Apple Macintosh Personal computer, with the Macintosh 128K Apple Inc, ( formerly Apple Computer Inc, is an American Multinational corporation with a focus on designing and manufacturing Consumer electronics Mac OS is the trademarked name for a series of Graphical user interface -based Operating systems developed by Apple Inc Macintosh, commonly nicknamed Mac is a Brand name which covers several lines of Personal computers designed developed and marketed by Apple Inc A personal computer ( PC) is any Computer whose original sales price size and capabilities make it useful for individuals and which is intended to be operated For the first few releases, Mac OS (or System Software, as it was called) lacked many essential features, such as multitasking and a hierarchical filesystem. With time, the OS evolved and eventually became Mac OS 9 and had many new features added, but the kernel basically stayed the same. Against this, Mac OS X is based on Darwin, which uses a hybrid kernel called XNU, which was created combining the 4.3BSD kernel and the Mach kernel. Mac OS X (mæk oʊ ɛs tɛn is a line of computer Operating systems developed marketed and sold by Apple Inc, the latest of which is pre-loaded on all currently Darwin is an open source UNIX -based computer Operating system released by Apple Inc XNU is the computer Operating system kernel that Apple Inc acquired and developed for use in the Mac OS X Operating system and released Mach is an Operating system Microkernel developed at Carnegie Mellon University to support operating system research primarily distributed and parallel [55]
The Commodore Amiga was released in 1985, and was among the first (and certainly most successful) home computers to feature a microkernel operating system. AmigaOS is the default native Operating system of the Amiga personal computer Commodore, the commonly used name for Commodore International, was a US-American Electronics company based in West Chester Pennsylvania The Amiga is a family of Personal computers originally developed by Amiga Corporation. The Amiga's kernel, exec. library, was small but capable, providing fast pre-emptive multitasking on similar hardware to the cooperatively-multitasked Apple Macintosh, and an advanced dynamic linking system that allowed for easy expansion. In Computer science, a library is a collection of Subroutines used to develop Software. [56]
Microsoft Windows was first released in 1985 as an add-on to MS-DOS. In 1983 Microsoft announced the development of Windows, a Graphical user interface (GUI for its own Operating system ( MS-DOS) that had shipped Microsoft Windows is a series of Software Operating systems and Graphical user interfaces produced by Microsoft. MS-DOS (short for M icro' s' oft D isk O perating S ystem is an Operating system commercialized by Microsoft. Because of its dependence on another operating system, some believe this means it cannot be an operating system itself, although whether this is true depends entirely on the definition of operating system in use. This product line would continue through the release of the Windows 9x series (upgrading the systems's capabilities to 32-bit addressing and pre-emptive multitasking) and end with Windows Me. Windows 9x is the family of Microsoft Windows Operating systems that comprises the hybrid 16/32-bit Windows versions Windows 95, Windows 98 Windows Millennium Edition, or Windows Me (IPA pronunciation, iː is a hybrid 16-bit / 32-bit graphical Operating system released on 14 September Meanwhile, Microsoft had been developing Windows NT, an operating system intended for high-end and business users, since 1993. Windows NT is a family of Operating systems produced by Microsoft, the first version of which was released in July 1993 This line started with the release of Windows NT 3.1 and came to an end with the release of the NT-based Windows 2000. Windows NT 31 is the first release of Microsoft 's Windows NT line of server and business desktop Operating systems and was released to Windows NT is a family of Operating systems produced by Microsoft, the first version of which was released in July 1993 Windows 2000 (also referred to as Win2K) is a preemptive, interruptible graphical and business-oriented Operating system designed to work with
Windows XP brought these two product lines together, attempting to combine the stability of the NT line with consumer features from the 9x series. Windows XP is a family of 32-bit and 64-bit Operating systems produced by Microsoft for use on Personal computers including home and [57] It uses the NT kernel, which is generally considered a hybrid kernel because the kernel itself contains tasks such as the Window Manager and the IPC Manager, but several subsystems run in user mode. Windows NT 31, Windows NT 35, Windows NT 351, Windows NT 40, Windows 2000, Windows XP, Windows Server 2003, Windows [58]
Although Mach, developed at Carnegie Mellon University from 1985 to 1994, is the best-known general-purpose microkernel, other microkernels have been developed with more specific aims. Mach is an Operating system Microkernel developed at Carnegie Mellon University to support operating system research primarily distributed and parallel Carnegie Mellon University (also known as CMU) is a private Research University in Pittsburgh, Pennsylvania, United The L4 microkernel family (mainly the L3 and the L4 kernel) was created to demonstrate that microkernels are not necessarily slow. L4 is a family of second-generation Microkernels based on theoriginal designs and implementations by German Computer scientist Jochen Liedtke. [46] Newer implementations such as Fiasco and Pistachio are able to run Linux next to other L4 processes in separate address spaces. Linux (commonly pronounced ˈlɪnəks [59][60]
QNX is a real-time operating system with a minimalistic microkernel design that has been developed since 1982, having been far more successful than Mach in achieving the goals of the microkernel paradigm. QNX (pronounced either Q-N-X or Q-nix is a commercial Unix-like Real-time operating system, aimed primarily at the Embedded systems market A real-time operating system ( RTOS; generally pronounced as "are-toss" is a multitasking Operating system intended for real-time [61] It is principally used in embedded systems and in situations where software is not allowed to fail, such as the robotic arms on the space shuttle and machines that control grinding of glass to extremely fine tolerances, where a tiny mistake may cost hundreds of thousands of dollars, as in the case of the mirror of the Hubble Space Telescope. An embedded system is a special-purpose Computer system designed to perform one or a few dedicated functions often with Real-time computing constraints NASA 's Space Shuttle, officially called the Space Transportation System ( STS) is the Spacecraft currently used by the United States The Hubble Space Telescope ( HST; also known colloquially as "the Hubble" or just "Hubble" is a space telescope that was carried into [62]
For notes referring to sources, see bibliography below. A kernel is the core component of every computer Operating system. An operating system (commonly abbreviated OS and O/S) is the software component of a Computer system that is responsible for the management and coordination Computer data storage, often called storage or memory, refers to Computer components devices and recording media that retain digital Virtual memory is a Computer system technique which gives an application program the impression that it has contiguous working memory while in fact it may be physically In Computer Operating systems that have their Main memory divided into pages, paging (sometimes called swapping) is a transfer In computing memory segmentation is one of the most common ways to achieve Memory protection; another common one is Paging. In Computer Operating systems that have their Main memory divided into pages, paging (sometimes called swapping) is a transfer "kernel space" redirects here For mathematical definition see Null space. A memory management unit ( MMU) sometimes called paged memory management unit ( PMMU) is a Computer hardware component responsible for handling In computing Multitasking is a method by which multiple tasks also known as processes, share common processing resources such as a CPU. In computing a process is an instance of a Computer program that is being sequentially executed by a computer system that has the ability to run several computer A thread in Computer science is short for a thread of execution. Scheduling is a key concept in Computer multitasking and Multiprocessing Operating system design and in Real-time operating system design Time-sharing refers to sharing a computing resource among many users by multitasking. A context switch is the Computing process of storing and restoring the state ( context) of a CPU such that multiple processes can share Inter-Process Communication ( IPC) is a set of techniques for the exchange of data among two or more threads in one or more processes. In Computing, input/output, or I/O, refers to the communication between an Information processing system (such as a Computer) and the outside In computing a device driver or software driver is a Computer program allowing higher-level computer programs to interact with a Hardware device A compiler is a Computer program (or set of programs that translates text written in a computer language (the source language) into another