The Structure of UNIX

The UNIX Operating System can be divided into three parts structurally, namely,

Ø A core unit called the kernel that interacts with the hardware for low level functions

Ø An outer unit called the shell that interacts with the user to perform functions desired by the user

Ø The File System

The idea of such a structure was to keep the units related but still separate so that the entire program did not park itself in the memory and slow down the system.

The Kernel

The core unit that manages the hardware and the executing processes is called the kernel. When the computer is switched on, the program UNIX is loaded into the computer's main memory, where it remains until the computer is shut down. This program, called the kernel, performs many low-level and system-level functions. The kernel is responsible for interpreting and sending basic instructions to the computer's processor. The kernel is also responsible for running and scheduling processes and for carrying out all input and output. The kernel is the heart of a UNIX system and there is one and only one kernel.

To list, the tasks of the kernel include

Ø CPU Scheduling

Ø Allocating the necessary hardware

Ø Controlling the I/O operations

UNIX is a multi-tasking, multi-user operating system, which implies that several users can work on the system at the same time and each user can submit several jobs for execution at the same time. In order to effectively manage the several tasks that run simultaneously, the kernel has to allot a tag that would enable the identification of any task, uniquely. The simplest form of identification for the kernel is the use of an integer.

For every job that is initiated, the kernel assigns an identification number called the process id. The kernel maintains a table called the Process Tab that describes every running process, enabling the identification of the details of the running process by means of the process id of the process, which is also stored in the table along with several other details. When a process is initiated, the kernel creates an entry in the process table and this entry is discarded from the table once the process is completed or its execution ceases. Each entry in the process table also indicates the priority of the process. This priority is a factor that determines the fashion or order in which the CPU allots time to the processes. Once a process gains the attention of the CPU, the process runs for an interval and then the CPU moves on to execute another process that deserves allocation. The interval is the period of time for which the process runs. This concept of giving each process a particular interval of time ensures that all processes get a chance to run and no process starves without the allocation of the CPU. The operating system handles the allocation and reallocation at a mind boggling speed that the users can hardly make out that the CPU is not allotted to them and they only have the feeling that the system is responding to all their requests simultaneously.

The Shell

As the shell of a nut provides a protective covering for the kernel inside, a UNIX shell provides a protective outer covering. As you might suspect from the critical nature of the kernel's responsibilities, the instructions to the kernel are complex and highly technical. To protect the user from the complexity of the kernel, and to protect the kernel from the shortcomings of the user, a protective shell is built around the kernel. The user makes requests to a shell, which interprets them and passes them on to the kernel.

A shell is a program dedicated to a single user, and it provides an interface between the user and the UNIX kernel.

Because any program can be executed from the login—and a shell is simply a program—it is possible for you to write your own shell. In fact, three shells, developed independently, have become a standard part of UNIX. They are

Ø The Bourne shell developed by Stephen Bourne

Ø The Korn shell developed by David Korn

Ø The C shell developed by Bill Joy

This variety of shells enables you to select the interface that best suits your needs or the one with which you are most familiar.

Bourne Shell

It is the most widely used UNIX shell and is evidently, named after its developer Stephen Bourne. The Bourne shell prompts the user with a $ symbol. The Bourne shell, by itself, is a program by name sh.

Korn Shell

The Korn shell has more features than the Bourne shell and is named after its developer David Korn. It is also called ksh.

C Shell

The C shell has still additional features and was developed by Bill Joy. It is also called csh.

No comments:

Post a Comment