A Kernel is a computer program which is core and heart of an operating system acting as an interface (or bridge) between user-level applications (softwares) components and the hardwares.
Main Functions of Kernel:
-> Resource Allocation
-> Process Management
-> Memory Management
-> Disk Management
-> I/O Device Management
-> Security or Protection management
Types of Kernel:
1) Monolithic Kernels
Monolithic kernel is a single large process running entirely in a single address space. It is a single static binary file. All kernel services exist and execute in the kernel address space.In this kernel both user services and kernel services are kept in the same address space.It increases the size of the kernel, thus increases the size of the operating system as well.It provides CPU scheduling, memory management, file management, and other operating system functions through system calls and its execution is faster.The monolithic kernel is hard to extend.If a service crashes, the whole system crashes in monolithic kernel. If a new service is to be added in monolithic kernel, the entire operating system is to be modified.To write a monolithic kernel, less code is required.
Egs: Linux, BSDs (FreeBSD, OpenBSD, NetBSD), Microsoft Windows (95,98,Me), Solaris, OS-9, AIX, HP-UX, DOS, OpenVMS, XTS-400 etc.
In Microkernel user services and kernel services are implemented in different address space. The user services are kept in user address space, and kernel services are kept under kernel address space, thus also reduces the size of kernel and size of operating system as well.Microkernel provides minimal services of process and memory management.The communication between the client program/application and services running in user address space is established through message passing. They never interact directly. This reduces the speed of execution of microkernel.The user services are isolated from kernel services so if any user service fails it does not affect the kernel service and hence Operating system remain unaffected.This kernel is easily extendible.If the new services are to be added, they are added to user address space and hence, the kernel space do not require any modification. The microkernel is also easily portable, secure and reliable.To write a microkernel, more code is required.Eclipse IDE is a good example of Microkernel Architecture.
Egs: QNX, Symbian, L4Linux, Singularity, K42, Mac OS X, Integrity, PikeOS, HURD, Minix,Windows NT and Coyotos.
3) Hybrid Kernel
Hybrid kernel is a kernel architecture based on a combination of microkernel and monolithic kernel architecture used in computer operating systems.The idea behind this category is to have a kernel structure similar to a microkernel, but implemented in terms of a monolithic kernel. In contrast to a microkernel, all (or nearly all) operating system services in a hybrid kernel are still in kernel space. There are none of the reliability benefits of having services in user space, as with a microkernel. However, just as with an ordinary monolithic kernel, there is none of the performance overhead for message passing and context switching between kernel and user mode that normally comes with a microkernel.While there is no performance overhead for message passing and context switching between kernel and user mode, as in monolithic kernels, there are no performance benefits of having services in user space, as in microkernels.The hybrid kernel runs the same processes in kernel-mode microkernel. Additional the hybrid kernel runs the application IPC and the device drivers in kernel mode. In the user-mode is used for UNIX-Server, File-Server and applications. The goal of this architecture is to get the performance benefits of a monolithic kernel, with the stability of a microkernel.
Egs: NT kernel,XNU kernel,Windows OS[NT series]
A nanokernel is a small kernel that offers hardware abstraction, but without system services. Larger kernels are designed to offer more features and manage more hardware abstraction. Modern microkernels lack system services as well, hence, the terms microkernal and nanokernal have become analogous. Nanokernel or Picokernel is referred to a kernel where the total amount of kernel code, i.e. code executing in the privileged mode of the hardware, is very small.The term picokernel was sometimes used to further emphasize small size.A virtualization layer beneath an operating system, which is more precisely called a hypervisor.A hardware abstraction layer (HAL), which forms the lowest level portion of a kernel.Occasionally, the term nanokernel is used to describe a kernel that supports a nanosecond clock resolution.
The term nanokernel first appeared in the paper “The KeyKOS NanoKernel Architecture.” The KeyKOS nanokernel is a capability-based, object-oriented operating system (OS) that has been on the market since 1983. It was implemented to address requirements, such as reliability, security and consistent availability, for applications on the Tymnet hosts. It was intended for running several instances of multiple operating systems on a single hardware system. The KeyKOS nanokernel is roughly 20,000 lines of C code, which includes checkpoint, capability and virtual memory support. It can run within just 100 kilobytes of memory.
Exokernel is a type of operating system developed at the Massachusetts Institute of Technology that seeks to provide application-level management of hardware resources. The exokernel architecture is designed to separate resource protection from management to facilitate application-specific customization.Exokernels are typically small in size because of their limited operability.
Exokernels can be seen as an application of the end-to-end principle to operating systems, in that they do not force an application program to layer its abstractions on top of other abstractions that were designed with different requirements in mind. For example, in the MIT Exokernel project, the Cheetah web server stores preformatted Internet Protocol packets on the disk, the kernel provides safe access to the disk by preventing unauthorized reading and writing, but how the disk is abstracted is up to the application or the libraries the application uses.
Egs: The available library operating systems for Exokernel include the custom ExOS system and an emulator for BSD. In addition to these, the exokernel team created the Cheetah web server, which uses the kernel directly.A concept operating exokernel system is Nemesis, written by University of Cambridge, University of Glasgow, Citrix Systems, and the Swedish Institute of Computer Science. MIT has also built several exokernel-based systems, including ExOS.