Monday, October 12, 2009

Salient features of Unix

The Unix OS offers several salient features, the important of which are discussed below:

Multiuser capability
Among its salient features, what comes first is its multiuser capability. In a multiuser system, the same computer resources - hard disk, memory, etc. are accessible to many users. Of course, the users don't flock together at the same computer, but are given different terminals to operate from. A terminal, in turn, is a keyboard and a monitor, which are the input and output devices for that user. All terminals are connected to the main computer whose resources are availed by all users. So, a user at any of the terminals can use not only the computer, but also any peripherals that may be attached, say for instance a printer. One can easily appreciate how economical such a setup is than having as many computers as there are users, and also how much more convenient when the same data is to be shared by all.

At the heart of an Unix installation is the host machine, often known as a server or a console. The number of terminals that can be connected to the host machine depends on the number of ports that are present in its controller card. For example, a 4 port controller card in the host machine can support 4 terminals. There are several types of terminals that can be attached to the host. These are:
  • Dumb Terminals - These terminals consist of a keyboard and a display unit with no memory or disk of its own. These can never act as independent machines. If they are to be used they have to be connected to the host machine.
  • Terminal Emulation - A PC has its own microprocessor, memory and disk drives. By attaching this PC to the host through a cable and running a software from this PC we can emulate it to work as if it is a dumb terminal. At such times, however, the memory and the disk are not in use and the PC cannot carry out any processing on its own. Like a dumb terminal it transmits its processing jobs to the host machine. The software that makes the PC work like a dumb terminal is called Terminal Emulation Software. VTERM and XTALK are two such popularly used softwares.
  • Dial-In Terminals - These terminals use telephone lines to connect with the host machine. To communicate over telephone lines it is necessary to attach a unit called modem to the terminal as well as to the host. The modem is required to transmit data over telephone lines.
Multitasking Capability
Another highlight of Unix is that it is Multitasking, implying that it is capable of carrying out more than one job at the same time. It allows you to type in a program in its editor while it simultaneously executes some other command you might have given earlier, say to sort and copy a huge file. The latter job is performed in the 'background', while in the 'foreground' you use the editor, or take a directory listing or whatever else. This is managed by dividing the CPU time intelligently between all processes being carried out. Depending on the priority of the task, the operating system appropriately allots small time slots (of the order of milliseconds or microseconds) to each foreground and background task.

The very concept of a multiuser OS expects the same to be multitasking too. We can say this because even when a user is executing only one command at a time, the CPU is not dedicated to the solitary user. In all probability, there are ten more users who also demand execution of their commands. Unix, therefore, has to be on its toes all the time, obliging all the users connected to it.

Although crude, MS-DOS also provides a multitasking capability. The type of multitasking provided by MS-DOS is known as Serial Multitasking. In this type of multitasking one program is stopped temporarily while another is allowed to execute. At any given time only one task is run. You can liken this to a situation in which a human working on a computer stops his work to answer a ringing phone and then, having finished with the call, switches back to the computer.

Most of us have used Sidekick or some other memory resident program. Once we load this into memory, a simple keystroke can take us from Sidekick to another program we may be running or vice versa.

If, for example, we invoke Sidekick in the middle of some calculation being done, then all work on the calculations would be stopped as the computer responds to Sidekick. Once you are through with Sidekick and you hit a key to go out of Sidekick the calculations would then be resumed. Wouldn't it be far better to give Sidekick only a part of the computer's time? So that even while we were in Sidekick the calculations would carry on being performed in the background. And this is exactly what Unix does. Using the timer interrupt it schedules the CPU time between programs. These time periods are known as time-slices. If there were 10 programs running at one time, the microprocessor would keep switching between these 10 programs. At a given point in time only one program will be handled by the CPU. But because the switch happens very fast we get the feeling that the microprocessor is working on all the programs simultaneously.

Thus, multitasking of Unix is different from DOS which doesn't give time slices to running programs. And if there are 5 programs running in DOS and even one goes haywire, the entire machine hangs. In any genuine multitasking environment like Unix this doesn't happen.

Does Unix give equal time-slices to all programs running in memory? No. There may be some programs that are relatively more important. For example, those that wait for use responses are given a higher priority. Programs which have the same priority are scheduled on a round-robin basis.

No comments:

Post a Comment