Wednesday, October 14, 2009

Unix system organization

The functioning of Unix is manned in three levels. On the outer crust reside the application programs and other utilities, which speak our language. At the heart of Unix, on the other hand, is the Kernel, which interacts with the actual hardware in machine language. The streamlining of these two modes of communication is done by the middle layer, called the Shell.

The Shell, or the command interpreter as it is called, is the mediator, which interprets the commands that we give and then conveys them to the kernel which ultimately executes them. You can imagine kernel as a monarch who is in overall control of everything, whereas the shell as its emissary.

The kernel has various functions. It manages files, carries out all the data transfer between the file system and the hardware, and also manages memory. The onus of scheduling of various programs running in memory or allocation of CPU time to all running programs also lies with the kernel. It also handles any interrupts issued, as it is the entity that has direct dealings with the hardware.

The kernel program is usually stored in a file called 'unix' whereas the shell program is in a file called 'sh'. For each user working with Unix at any time different shell programs are running. Thus, at a particular point in time there may be several shells running in memory but only one kernel. This is because, at any instance Unix is capable of executing only one program as the other programs wait for their turn. And since it's the kernel which executes the program one kernel is sufficient. However, different users at different terminals are trying to seek kernel's attention. And since the user interacts with the kernel through the shell different shells are necessary.

No comments:

Post a Comment