1
8.8kviews
Explain different kernel architectures?
1 Answer
0
70views
  • A kernel is a central component of an operating system. It acts as an interface between the user applications and the hardware.
  • The sole aim of the kernel is to manage the communication between the software (user level applications) and the hardware (CPU, disk memory etc).

The main tasks of the kernel are:

  • Process management
  • Device management
  • Memory management
  • Interrupt handling
  • I/O communication
  • File system...etc.
  • There is a difference between kernel and OS.
  • Kernel as described above is the heart of OS which manages the core features of an OS while if some useful applications and utilities are added over the kernel, then the complete package becomes an OS.
  • So, it can easily be said that an operating system consists of a kernel space and a user space.
  • So, we can say that Linux is a kernel as it does not include applications like file-system utilities, windowing systems and graphical desktops, system administrator commands, text editors, compilers etc.
  • So, various companies add these kind of applications over linux kernel and provide their operating system like ubuntu, suse, centOS, redHat etc.

Types Of Kernels

  1. Monolithic
  2. Micro Kernel

Monolithic Kernel

  • Earlier in this type of kernel architecture, all the basic system services like process and memory management, interrupt handling etc were packaged into a single module in kernel space.
  • This type of architecture led to some serious drawbacks like

    1) Size of kernel, which was huge.

    2)Poor maintainability, which means bug fixing or addition of new features resulted in recompilation of the whole kernel which could consume hours

  • In a modern day approach to monolithic architecture, the kernel consists of different modules which can be dynamically - This modular approach allows easy extension of OS's capabilities. With this approach, maintainability of kernel became very easy as only the concerned module needs to be loaded and unloaded every time there is a change or bug fix in a particular module.

  • So, there is no need to bring down and recompile the whole kernel for a smallest bit of change. Also, stripping of kernel for various platforms (say for embedded devices etc) became very easy as we can easily unload the module that we do not want.

Linux follows the monolithic modular approach

Monolithic Kernel Advantages

  • A monolithic OS kernel is faster due to small source and compiled code size. Less code means also less bugs and security issues.

Microkernels

  • This architecture majorly caters to the problem of ever growing size of kernel code which we could not control in the monolithic approach.
  • This architecture allows some basic services like device driver management, protocol stack, file system etc to run in user space.
  • This reduces the kernel code size and also increases the security and stability of OS as we have the bare minimum code running in kernel. So, if suppose a basic service like network service crashes due to buffer overflow, then only the networking service's memory would be corrupted, leaving the rest of the system stillfunctional.

In this architecture, all the basic OS services which are made part of user space are made to run as servers which are used by other programs in the system through inter process communication (IPC). eg: we have servers for device drivers, network protocol stacks, file systems, graphics, etc.

Microkernel servers are essentially daemon programs like any others, except that the kernel grants some of them privileges to interact with parts of physical memory that are otherwise off limits to most programs. This allows some servers, particularly device drivers, to interact directly with hardware. These servers are started at the system start-up.

Microkernel Advantages

Here some advantages to the microkernel OS architecture…

  1. Service separation has the advantage that if one service (called a server) fails others can still work so reliability is the primary feature. For example if a device driver crashes does not cause the entire system to crash. Only that driver need to be restarted rather than having the entire system die. This means more persistence as one server can be substituted with another. It also means maintenance is easier.
  2. Different services are built into special modules which can be loaded or unloaded when needed. Patches can be tested separately then swapped to take over on a production instance.
  3. Message passing allows independent communication and allows extensibility
  4. The fact that there is no need to reboot the kernel implies rapid test and development.
  5. Easy and faster integration with 3d party modules.

Microkernel Disadvantages

Here are some disadvantages to the microkernel approach…

  1. Memory foot print is large
  2. Potential performance loss (more software interfaces due to message passing)
  3. Message passing bugs are not easy to fix
  4. Process management is complex

Hybrid kernel

The hybrid approach is derived from the best of both micro and monolithic kernel architectures. Instead of loading the whole thing into memory, core modules are loaded dynamically to memory on demand. One disadvantage is that a module may destabilize a running kernel.

Please log in to add an answer.