Kernel is heart of Operating System and it operates as a connecting bridge between applications and hardwares. The only goal of Kernel is manage the connection between applications (apps which owner of phone device uses) and hardware (CPU, Storage and …).
Main mission of Kernel:
Managing the process, managing the phone, managing the storage, stopping application from running, making connection between I/O (Input/Output), working as system files (a system to manage files and saving them).
Is linux a Kernel? Or its just an Operating System?
Well, there are some differences between OS and Kernel. As we just mentioned, Kernel is the heart of OS which manages features of OS. If we add some useful applications to Kernel, we can name it an operating system.
Operating system is made up of two parts: Kernel space and user space.
User space is RAM space actually, which is under your control. And kernel space is a space that theres kernel inside of it. And don’t forget that every process and applications that runs by user, its directly in touch with kernel space and the system that makes this connection, is called “System Call”. Actually, Linux is kind of a Kernel but it doesn’t have those apps that Kernel has it. So, companies make some other special application for Linux and this is how they make their own OS, like redHat, centOS, suse, Ubuntu and … .
There Are Two Main Kinds of Kernel:
In structure of very first series of Microkernels, all of the basic data of processing, memory management and other data that should be in kernel, they place in one space, inside of kernel. This kinds of Kernels, had lot of problems and one of their biggest problems was their big size. Another problem they had was that they were weak to keep the data inside; to solve this problem, or add a feature, it needed to reload the whole data all over again and this process took hours to be done. Nowadays, we can see Monolithic structure, which Kernel is made up of different parts and each of these parts have different functions and activities.
Because of these access to each parts, Operating Systems nowadays improved. With this feature, keeping Kernel’s data is being easy. Because nowadays, Kernels made up of different parts for applications, data and … and if something happens to one part of Kernel, nothing is going to happen to other parts of Kernel, so you only need to solve the problem of that part without needing to access to other part’s data. Simply, if you need to rewrite and edit one part of Kernel, you wont need to rewrite the whole data of Kernel, but only data of that part with problem inside of it. In these type of Kernels, system like memory management, system files, or phone device’s drivers, place in one place, all together!
When a system starts to working, and because the whole data is in one place, the system which started to working and processing, have access to other parts. So the system could access and read wrong codes (codes and data of other parts), so you have to be careful while you are writing Kernel’s code, otherwise this kind of problem would show up. Function of Monolithic Kernels are much better than Microkernels. Kernel’s codes, do their own job at the moment that phone device starts working and they support all of the Kernel’s functions and activities and they cover Monolithic Kernels somehow.
Structure of Microkernel is solved the problem of long codes that we faced with it in Monolithic (in Monolithic Kernels, all of the codes placed in one place and so they are written code after code and so they seem like a very long code). This Microkernels, lets some services like mobile device’s management, system files and … run inside of user space. This feature made the long code shorter which increases OS’ security and stability. Imagine when something happens to one of the services like network and if it stops working, due to Microkernle’s structure, every single services placed in separate parts, nothing will happen to other services and they will work fine (if such a thing happens to Monolithic Kernel, because all of the codes are placed in one place, code after code, so you have to re-write and edit the whole codes of every services to solve the problem).
In microkernels, all of the basic services that OS presents, contains part of user space; and other applications and services are in touch with this basic services and they exchange data between themselves. This kind of data exchanging is called “Inter Processing Communication (IPC)”. For example: we have servers for phone device’s driver, network, system files, graphic and … . this servers, are important just like other applications and programs, but there’s only one difference between these servers and applications: Kernel lets these servers to be in touch with applications and programs which are in user space or letting them to have IPC. That’s why some servers have permission to get in touch directly with hardware.
these servers, starts to running right after booting the system and only basic functions executing Inside of Microkernels, and rest of the functions (system files, memory management and…) automatically, exchanging data with Microkernel through IPS.
Another good features and functions we can point out is Microkernel’s wide improvements, also Microkernels can change apps and parts with one another while they are running.
Beside of things we said in this article, each services can be part of user space or they can work as servers!
So, this article was about Kernel and different kinds of it. Hope you enjoyed it.
Nasima Babaki / Mobile Section of Dr-Bios.com