In this blog, I would like to share with you " An overview of UNIX kernels". Well some of you might be wondering what is a kernel ?? Am I right ?? Yes I am.
So here is the definition of kernel...
The kernel is the core of an operating system, it is loaded into main memory at boot time and it stays in the main memory until shut down. The kernel has two main responsibilities..
Mainly there are two types of kernels...monolithic kernels and microlithic kernels...More on that in my next post...
And now back to Unix Kernels....
Unix kernels provide an execution environment for the applications or processes. The applications can interact with other components of the system (mainly hardware) with the help of the resources, interfaces and the set of services provided by the kernel.
Processes and Threads
A process can be defined as program in execution. And thread can be defined as a sort of independent 'strand' in the course of a program execution. As opposed to processes, threads work on the same memory and can influence each other. The process of creating, terminating and synchronizing the process is controlled by a set of kernel routines.
Unix process/kernel model
In unix there are two modes of execution, they are user mode and kernel mode. User mode can be defined as a less privilaged mode. Because in user mode the process cannot access the kernel data structures. And the kernel mode is the high privilaged mode. In the kernel mode, a process can access all the kernel data structures. Normally, a program run in user mode but when a system call or interrupt comes it switch from user mode to kernel mode.
Re-entrant kernels
Unix has re entrent kernel. It simply means that several processes are executing in kernel mode at the same time. Yes ofcourse one process at one instant of time. Only one process will be executing and the other processes might be waiting. If the currently executing process needs
to do a read/ write operation on harddisk. The current process is temporarily stopped and the control is given to the device handler. And the kernel may start another process that is waiting. And when the the hard disk operation ceases the device handler raises an interrupt showing that the operation is over. And now the former process which was in the halt state comes back to execution. This feature in unix/linux kernels is called re-entrancy.
One way to provide re - entrancy is to write functions which allows to change the local variables but protects the global data structures from being modified. Such functions are called re-entrant functions. So in a re-entrant kernel an interrupt can stop a process even if it is in the kernel mode.
This is the basic overview of unix kernels.

1 comments:
thanks man ......
Post a Comment