Tuesday, November 2, 2010

Types of kernel

The kernel is a program that constitutes the central core of a operating system. It has complete control over everything that occurs in the system. 

The kernel is the first part of the operating system to load into memory during booting and it remains there for the entire duration of the computer session because its services are required continuously. Thus it is important for it to be as small as possible while still providing all the essential services needed by the other parts of the operating system and by the various application programs.

Because the service provided by kernel is critical in nature, the kernel is usually loaded into a protected area of memory so no other programs are able to interfere with kernel. 

The kernel provides basic services for all other parts of the operating system, typically including memory management, process management, file management and I/O (input/output) management.  Application programs can reuse these services using specified set of functions called System Calls.

Most of the kernels are designed for a specific operating system. For example Microsoft Windows XP kernel is only for Microsoft Windows XP. A few kernels have been designed for being suitable to use with any operating system. A best example of it is Mach kernel developed at Carnegie Mellon University and is used in Macintosh OS X operating system.


Categories of kernel :

Kernels can be classified in following major categories.

Monolithic kernel:

The word “monolithic” means everything in a single piece. So as the name implies, these kernels have been used by UNIX – like operating systems. It contains all the core operating system functions and device drivers. These functions do not run in separate process. Context switching is very less so it s faster.

Architecture of monolithic kernel

Since every function in the kernel has all privileges, a bug in one function can corrupt data structures of other. The whole kernel is less modular.

Pros

    * Speed
    * Simplicity of design

Cons

    * Potential stability issues
    * Can become huge - Linux 2.6 has 7.0 million lines of code
    * Potentially difficult to maintain

Examples

    * Traditional Unix kernels (For example  BSDs and Solaris)
    * Linux
    * MS-DOS, Windows 9x
    * Windows CE ( Embedded monolithic kernel)
    * Embedded Linux (Embedded monolithic kernel)



Microkernel:

In the Microkernel, only the most fundamental of tasks are performed. It usually provides only minimal services, such as defining memory address spaces, interprocess communication (IPC) and process management. All other functions, such as hardware management, are implemented as processes running independently of the kernel. Most Microkernels use a message passing system of some sort to handle requests from one server to another.

Architecture of Microkernel

Pros

    * Stability
    * Security
    * Potentially more responsive (though often not in practice)
    * Benefits for SMP machines

Cons

    * Additional context switches are usually required
    * Slow Inter Process Communication can result in poor performance

Examples of Microkernels and OSs based on Microkernels:

    * AIX
    * AmigaOS
    * Amoeba
    * Chorus Microkernel
    * EROS
    * K42
    * Minix
    * MorphOS
    * QNX
    * RadiOS
    * Spring Microkernel


Hybrid kernel:

As the word “Hybrid” in category implies, Hybrid kernels combine concepts of both monolithic kernels and Microkernels. When properly implemented it is hoped that this will result in the performance benefits of a monolithic kernel, with the stability of a Microkernel. Most modern operating system kernels today fall in this category.
Architecture of Hybrid kernel


Examples

    * NT kernel (used in Windows NT, 2000, XP, Vista and Windows 7)
    * Dragonfly BSD
    * Mac OS
    * BeOS
    * Plan 9

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.