Skip to main content

Operating System Kernel: An Overview


What is Linux Kernel?
   In previous post, we have seen the structure of Linux operating system. We know that Linux kernel is the core part of Linux and every process of operating system passes through kernel. Also, only kernel has permission to access hardware directly.
    But where is exactly this kernel? There are two, say, spaces in operating system. User space and kernel space are the two layers where operating system operates. User space is where user library is located. Below user space comes kernel space which is where kernel is located.

credits: IBM
Linux kernel space and user space


   What is the use of kernel? Functions of kernel:
   There are various functions performed by kernel are:
1)      Resource allocation:- Kernel decides how the processes can access computer resources like CPU, RAM, I/O, etc.
2)      Inter-Process Communication:- Kernel acts as an agent for communication between processes when required.
3)      Memory Management:- Kernel has access to system memory and it is responsible to provide access to processes on request.
4)      Device Management:- Kernel has access to hardware, thus acts as an interface between hardware and process whenever they require to communicate. This is done by the device drivers present in kernel.
5)      System calls: - System calls are the gateways for processes to communicate with kernel.  They act as an interface between processes and kernel, in case a process require an access to system resources. They are generally c-library- glibc in case of Linux.
Types of kernels:
1)      Monolithic kernel: - For monolithic kernel, all the OS services run along the main kernel thread. This provides powerful access to hardware. The main con of having a monolithic kernel is that monolithic kernels are a lot dependent on system components. Thus a bug in a device driver may crash the whole system. Linux mainly runs on monolithic kernel.
2)      Microkernel: - Micro kernel mainly intends the kernel to keep the basic functionalities. Other functionalities such as networking are kept in user space. These functionalities are performed by set of servers which communicates through kernel. Thus a microkernel removes the flaw of monolithic kernel, where bugs in functionality does not prove harmful for entire kernel, though performance is affected.

3)      Modular kernel (Hybrid kernel):- As” Hybrid” suggests, a Modular kernel lies between Monolithic and Microkernel. Microkernel has only essential function in kernel, whereas monolithic kernel has every system functionality inside of kernel. Hybrid kernel has some of the non essential system function code inside kernel to make it perform faster. Windows 10 and Mac OS X are the examples.
4)      Nano kernel: - Nano kernel is a kernel of extremely small size. Nanokernel was derived from microkernel, where the size of the kernel is further reduced down.
5)      Exokernel: - Exokernels are still in development stage. In exokernel, hardware level access is given to even top level of abstraction. This is done to provide as few abstractions between hardware and developers as possible.
Thus an overview of kernel was seen, its functions, and types of kernel are known.

  
   

    

Comments