Chapter 1: Introduction: 1.2.1 PORTABILITY

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 10

CHAPTER 1 : INTRODUCTION

UNIX has been described as the operating system of the 90s. From a low profile beginning at the Bell labs in the late 60's it has come a long way to become a global phenomenon. The UNIX operating system has evolved in the past twenty years, from its invention as an experiment to become one of the most popular and powerful operating system today in the world. Today more than a million people use the UNIX operating system and it is available on over a hundred different types of computers, ranging in size from the microcomputers to the largest mainframe and super computer. The growth is amazing as more and more users succumb to the amazing features of the UNIX system.

1.1 WHAT IS AN OPERATING SYSTEM?


A computer system (hardware) is just a collection of metal, silicon, communication equipment and magnetic media. On its own it is not at all useful to the users. It is the application programs, which make a computer system useful to the users. An Operating System is a program, which acts as an interface between the user and the computer hardware. It is the heart of any machine's software. computer resources in an efficient manner. The operating system is designed to make the computer system convenient to use for the users and to use the

1.2 FEATURES OF UNIX


UNIX is a comprehensive operating system with an amazing array of features and capabilities. Its major features are:

1.2.1 PORTABILITY:
Portability is the ability of the software that operates on one machine to operate on another machine having a different configuration. UNIX system itself is portable. This can be seen from the fact that UNIX system has been ported to nearly every moderate and large computer ever built. The main reason for the portability of the UNIX system is that more than 90% of the system is written in a machine independent high level language 'C', and less than 10% is written in machine specific assembly language. Thus, only a few minor changes and adaptations are required to make UNIX available on a different computer. Another aspect of portability is that application programs developed under UNIX can easily be ported to another system with little or no changes. Theoretically speaking, it is possible

Introduction to take an application that was developed on a UNIX microprocessor-based computer & have it run in a UNIX super computer environment and vice-versa, with just a compile & link of the source code on the new platform. This increases program productivity and decreases programming costs. UNIX also allows the user to transfer data from one system to another .

1.2.2 MULTIUSER
UNIX is a multi-user system, that is, it allows several users to use the same computer simultaneously. At the same time all these users have the same "private" view of their system, as does a single user on a microcomputer. UNIX allows several users, say those involved in a common project, to gain access to the same data more or less at the same time, UNIX generally uses the time sharing method. A multi-user system generally costs less than the equivalent number of single user systems. utilization of the processing power. In this way it allows efficient

1.2.3 MULTITASKING
UNIX supports multitasking-the ability to perform more than one task at a time. A task is a job initiated by the user. For example, sorting a file, compiling a program or executing a command to list the contents of a directory are tasks. In UNIX, a user can assign several tasks to the system simultaneously in the background while working on a task in the foreground. Usually, all tasks do not require interaction with the user, like, sorting a large file or printing a report etc. Foreground tasks are those in which the user has to wait for the completion of the present task before he can initiate another. Eg. Like editing a file or using a word processor. Thus in UNIX a user, may be simultaneously editing a file, sorting a large file, sending electronic mail to another machine and at the same time printing a file on a printer The tasks that should have been given sequentially, can be given simultaneously in a multitasking system, thus allowing the tasks to be accomplished in a lesser period of time.

1.2.4 MODULARITY
UNIX is unique in its modular design. UNIX consists of a large number of independent Depending upon the modules or programs that performs different elementary tasks. the rest of the system. For eg; The man command which displays the manual (online), takes around 2 to 3 MB of disk space. This may be too much of a space for a micro computer system and hence, may be removed to make room for the user's program or data files, without affecting the

requirements various modules may be added or removed without affecting the operation of

Introduction system. This gives UNIX the flexibility as the working environment can be tailored to meet

the user's needs.

Introduction

1.2.5 FILE SYSTEM


The UNIX file system is a multi level tree. information or data. Files can be grouped together according to usage. For eg; All files and data for an accounting package can be kept in a single directory, say account. This structure offers maximum flexibility for grouping information in a way that reflects its natural structure. UNIX also allows the user to control the access to these files and data by others. UNIX uses a hierarchical structure for organizing

1.2.6 SHELL
Shell is the user interface with the system. out. The shell includes a large number of functions and supports a number of features. For example the ability to redirect the input and output, to run a command in the background, the ability to manipulate a group of files with a single command etc. feature of the shell is the ability to use it as a programming language. Another important In UNIX, it is the shell, which accepts the commands and translates them into instructions, so that the requisite action can be carried

1.2.7 PIPING
Piping is a mechanism that allows a stream of data to be passed between two processes. In piping the output of the first command becomes the input for the next command/process. It allows the user to combine several simple commands or programs to perform various complex functions, thus eliminating the need for new software development.

1.2.8 COMMUNICATION
Communication features are available as part of the UNIX system. UNIX allows different users to communicate among themselves, such as requesting for some information. Communication between different computers at different locations by means of a network, is also supported by UNIX.

Introduction

1.2.9 SECURITY
UNIX system provides several safeguards for system security. Each user is provided with a password to prevent unauthorized users from accessing the user's account. UNIX also provides security at file and directory level. The user has control over the access to individual files. UNIX also provides several other security measures such as encryption of data files and system accounting functions which are useful for analysis of which users did what.

1.2.10 UNIX TOOLS & UTILITIES:


Tools are programs that are not necessary for the basic operation of a computer, but significantly add on to the value of the system. UNIX provides more than 400 different tools to accomplish various functions such as sorting data or searching for information and various other functions. UNIX also provides a rich assortment of tools for all aspects of text processing. Text editing utilities support the creation, editing & management of documents. Unix also provides an extensive array of software tools, which support all phases of the software development process, from program editing through debugging.

1.2.11 MATURITY
UNIX is a solid, time-tested operating system, which has been in use for nearly two decades. The software has been tested and it has evolved into a mature OS, which is relatively free of bugs, thus offering a high level of reliability.

1.3 HISTORY OF THE UNIX SYSTEM


UNIX originated in AT &T's Bell Laboratories in the late sixties, as a reaction to the large and clumsy operating system available at that time. needs and creativity of the user. The emergence of UNIX is almost unique in comparison to other major computer operating systems. Advances are largely the results of individual people with unique creative ideas. Like a great many of the best projects, this one started with the creation of a game called "Space Travel", which simulated the major celestial bodies in the solar system, for a mainframe computer and was developed by Ken Thompson. computer system, a DEC PDP-7. This system though offered a good hardware support, lacked the kind of software support needed for developing programs like Thompson's. Thompson wrote the necessary software The first and several utilities for the PDP-7 machine, thus giving rise to the UNIX system. Since, the mainframe proved to be too costly, Thompson decided to move the space travel program to a dedicated UNIX came into being directly from the

Introduction version of the UNIX system in 1969 was completely written in assembly language specific to the PDP-7. Ken Thompson was later joined by Dennis Ritchie and they together with several others, worked on the project. In 1970, the operating system was rewritten in a language called At the same time the UNIX operating system was "B", developed by Ken Thompson.

transported to the newer PDP-11 family of systems in early 1971. In 1971, Dennis Ritchie modified and extended language 'B,' calling the resultant language 'C'. Today UNIX is almost totally written in C language with a few subroutines written in assembly language.

1.3.1 UNIX Architecture


The interaction between the user and the hardware happens through the operating system. The operating system interacts directly with the hardware. It provides common services to programs and hides the hardware intricacies from them. The high level architecture of the UNIX system has been shown in Figure. Figure : System Architecture of CPU The of memory I/O UNIX hardware a UNIX is

system

present in the centre of the diagram. provides basic such It the as

services

memory management, processor execution level, etc. to the operating system. The UNIX system seems to be organised as a set of layers. The system Kernel is also called the operating system. The user programs are independent of the hardware on which they are running. Therefore, it becomes very easy to run programs on UNIX system running on different hardware if the programs do make special assumptions. The programs such as the shell and editors like (ed and vi) interact with the Kernel by invoking a well defined set of system calls. The system calls get various actions done from the Kernel for the calling program. They interchange data between the Kernel and the program. There are many other

Introduction programs in this layer which from a part of the standard system configurations. These programs are known as commands. But there are several other user created programs present in the same layer. It is shown by the program whose name is a.out. a. out is the standard name for all the executable files produced by the C compiler. The outer most layer contains other application programs which can be build on top of lower level programs. For instance, the C compiler, cc, appears in the outermost layer of the figure. It invokes a C preprocessor, compiler, assembler and link loader. These are all separate lower level programs. The programming style offered by the UNIX system helps us to fulfill a task by combining the existing programs.

1.4 Structure of UNIX system


The UNIX operating system consists of the following key components: Kernel Shell File System

1.4.1 The Kernel :


Kernel is the heart of the UNIX system. It is the master program that controls the computer's various resources like memory, I/O devices etc. and allocates them to the different users. The Kernel (comprises of 5-10% of the total software provided with the UNIX system) is the basic resident software on which the entire system relies. It is the only part of the system that permanently resides in the computer's memory. The kernel keeps track of all the various programs being run, allotting time to each, deciding when one stops and another starts. Thus, it is the kernel, which performs all the basic functions of an operating system such as maintaining the file system, allotting storage and controlling I/O etc. In other words kernel can be called as the operating system.

1.4.2 The Shell :


The UNIX user doesn't deal directly with the kernel. Instead, The kernel starts up a separate interactive program called the shell, whenever the user logs in. The shell acts as an interface between the system and the user and acts as a command interpreter. In its role as a command interpreter the shell takes user commands and sets them up for execution. The shell can also be used as a programming language. The user can write, "shell scripts " (shell programs) to perform complex tasks.

Introduction

1.4.3 File System:

The file system provides a method of handling data that makes it easy to store and access information. The file system provides a logical method of organizing, retrieving and maintaining information. The UNIX file system consists of a set of directories and files arranged in a tree like structure. The structure of the file system is hierarchical.

1.5 Key differences between DOS and UNIX


UNIX is a multi-user, multi-tasking system.
In DOS only one person can use the computer at a time. Also, that particular user can do only one job at any instant of time, ie., while the user is printing a report on the printer, he has to wait till the printing job is over in order to commence another job. While in the UNIX system several users may be using the same computer at the same time and each in turn may be performing several tasks at the same time. This allows better utilization of the computer resources. UNIX users have an identity. In the UNIX system each of the users in the system is identified by by a special name known as the login names. There can be a password corresponding to each login name. Thus only a person with a valid login name can log into the system and use it. This is in contrast with DOS where anyone can switch on the computer and start working (or destroying). UNIX shutdown is different from DOS When turning off a DOS system, one simply reaches over and turns the power switch off. But, this is not the case with UNIX system. As in case of DOS, if you simply turn the power off (or there is a power failure) then there is a chance that the file system may get corrupted. Next time when you switch on the system the UNIX system will go through a lengthy file system checking procedure, which tries and repair the damage caused. Thus, in UNIX system first you have to shutdown the UNIX operating system and only then can the computer be turned off. UNIX commands exist as files on the disk In DOS there are two types of commands - internal commands, those which are built into DOS such as dir,copy,date etc. and external commands such as diskcopy, sort etc. Which

Introduction exists as files. In UNIX all the commands exist as files on the disk. File System DOS has a multiple hierarchical file systems with their roots at A: or B: or C: or D: . Thus, in DOS the user has to remember where he is working and the user has to prefix the pathname with a A: or a:. In UNIX all the directories and sub-directories start at one root "/". Note, in DOS the root is designated by a "\"(backslash) and the directory or filename separator is also "\", i.e. a file Whereas, name is usually written as \accounts\reports\init.rpt. in UNIX the root is the "/" (slash) and the directory or filename seperator is

also "/", i.e. a file is written as /accounts/reports/init.rpt . Where things go in UNIX DOS has no standard place for any particular type of file.Whereas, every installation of UNIX has certain standard directories. Sub-directories at the root are /bin, /usr, /usr/bin , /etc etc. where certain similar system files go in. Devices in UNIX are also files In UNIX every physical device is treated as a file. Each physical device has one or more files associated with it and any reference to the physical devices are made through these files. In DOS there is no connection between the inside of the DOS system and the physical devices.

1.6 LOGGING IN
UNIX is a multi-user operating system, ie, several users will be using the system at the same time. You cannot just switch on your terminal and start working. Had this been the case there would not have been any privacy or security for your files. So, your first task is to identify yourself to the system so that it can respond to you in an individual way. For this reason, the UNIX system users are given a unique "user name", by means of which the user gains access to the system. The user name is also known as the 'login name'. The login name will be given to you by the system administrator, the person who has administrative duties of creating new user directories, assigning new user names, and is generally responsible for the day-to-day operation of the system.

Introduction Now, assuming that you have a login name and a terminal assigned, you can get started. Once, the terminal is turned on and connected to the UNIX system, it responds with the message "login:", prompting you to log into the system. The process followed for gaining access to the UNIX system is known as 'logging in', and to log into the system you just type your user name, followed by an optional password and then press the RETURN KEY. The UNIX system will not do anything until you press a RETURN KEY. Login: raju If a password is already assigned to you, the system responds by asking you for a password as shown below: Password: not displayed on the screen Type in your password, then press RETURN KEY. The password you enter is not displayed on the screen. This is because your password is confidential and others should not know it. When you have typed in your user name and password, the system checks whether you are a known user to the system and whether you have given the correct password or not.

1.7 LOGGING OUT:


When your session with the UNIX System ends, you can log out by typing CTRL.D (Pressing both <CTRL> and <D> key simultaneously) at the shell prompt. If you are successful then the system displays the login prompt as shown below: $ ^D login: Note, do not just turn off your terminal and leave. You must log out or else your terminal will remain online and another user could begin using your account.

10

You might also like