Thursday, June 12, 2014

UNIX


UNIX is a CUI operating system. Operating system is an interface between hardware and application software’s. It serves as the operating system for all types of computers including single-user personal computers and engineering work stations, multi-user micro computers, mini computers and super computers as well as special purpose devices. The number of computers running in variant of UNIX has grown explosively, with approximately 20 million computers and more than 100 million people using these systems.  The success of UNIX is due to many factors, including its portability to wide range of machines, its adaptability and simplicity, the wide range of tasks that it can perform, its multi-user and multi tasking nature, and suitability for networking, which has become increasingly important as the internet has blossomed.


A UNIX Biography
The origin of UNIX can be traced back to 1965, when a joint venture was undertaken by AT & T Bell laboratories, the General electric company and Massachusetts Institute of Technology and software team lead by Ken Thompson, Dennis Ritchie, Rudd Canday and Brain Kernighan worked on MULTICS project, (stands Multiplex Information and Computing System/Service). The aim was to develop an operating system that could serve a large community of users and allow them to share the data if need be. MULTICS was developed for only 2 users. Based on the concept in 1969, UNICS (stands Uniplexed Information and Computing System) operating system was developed for 100 users. The first version was armed with a museum computer called PDP-7 and later on PDP-11 which was written in Assembly language. All its assembly code being machine independent, the version was not portable, a key requirement for successful OS.
To remedy this, Ken Thompson created a new language ‘B’ came from BCPL (Basic combined programming language) and set about the herculean task of rewriting the whole UNICS code in this high level language. ‘B’ lacked in several aspects necessary for real life programming. Ritchie shifted the inadequacies of B and modified in to a new language which he named as ‘C’. In 1973, whole UNICS code was rewritten in ‘C’ language and named it as UNIX.
HP –UX -> HEWLETT PACKARD
SUN SOLARIS -> SUN MICROSYSTEM
IBM-AIX -> IBM
BSD -> Berkeley Software Distribution
IN 1991, LINUS TORVALD
HELSINKY UNIVERISTY, FINLAND
LINUX – GNU
FLAVOURS OF THE LINUX OPERATING SYSTEM:
1.      RED HAT
2.      SUSE
3.      FEDORA
4.      UBUNTU

Hardware Requirements for UNIX:
·         Minimum 80 MB of Hard disk and 4 MB of RAM.   
·         Any 80286 and above processor
·         UNIX requires about 1 MB of RAM for each extra terminal connected.

Salient Features of UNIX
Multi user Capability:
Multi user operating system means more than one user shares the same system resources (hard disk, memory, printer, application software etc.) at the same time.
Multi tasking Capability:

Another highlight of UNIX is that it is multi tasking, implying that it is capable of carrying out more than one job at the same time. It allows you type 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 editor, or take a directory list or whatever else. Depending on the priority of the task, the operating system appropriately allots small time slots (of the order of millisecond or microseconds) to each foreground and background task.
Programming facility:
UNIX o/s provides shell. Shell works like a programming language. It provides commands and keywords. By running these two, user can prepare efficient program.
Portability:
One of the main reasons for the universal popularity of Unix is that it can be ported to almost any computer system, with only bare minimum of adoptions to suit the given computer architecture. It works with 80286 processors to super computers.
Communication:
UNIX provides electronic email. The communication may be within the network of a single main computer, or between two or more such computer networks. The user can easily exchange mail, data, and programs through such networks. You may be two feet away or at two thousand miles your mail with hardly take any time to reach its destination.
Security:
UNIX provides three level of security to protect the data. The first is by provided by assigning passwords and login names to individual users ensuring that nobody can come and have access to your work. At the file level, there are read, write and execute permissions to reach a file which decide who can access a particular file, who can modify it and who can execute it. Lastly, there is a file encryption. This utility encodes your file into an unreadable format so that even if someone succeeds in opening it, your secrets are safe.
Open system:
The source code for the UNIX system and not just the executable code have been made available to users and programmers. Because of this many people have been able to adapt the UNIX system in different ways. This openness has led to introduction of wide range of new features and versions customized to meet special needs. It has been easy for developers to adapt to UNIX, because the computer code for the UNIX system is straight forward, modular and compact.
System calls:
Programs interact with the kernel through approximately 100 system calls. System calls tell the kernel to carry out various tasks for the program, such as opening a file , writing a file, obtaining information about a file, executing a program, terminating the process , changing the priority of a process and getting the time of a day. Different implementations of UNIX system have compatible system calls, with each call having the same functionality. However, the internal programs that performs the functions of the system call (usually written in C language).
Help facility:
UNIX provides manual pages for UNIX commands.




Differences of UNIX with WINDOWS
UNIX
 Windows
Unix is a multi-user o/s.
Windows is a multi-user o/s.
Multi tasking o/s.
Multi tasking o/s.
To boot the UNIX o/s 2MB RAM is required.
To boot the Windows o/s 12MB RAM is required.
Unix is process based concept.
Windows is process thread based concept.
In Unix, for every user requests it creates new process
For number of users request it creates only process.
In Unix, any process is killed it will not effect the other users.
It effects to all users.
Can run more than 1, 00,000 transactions per minute.
Maximum number of transactions in windows is 80,000 per minute.
There is no limit for number of users working with the server.
Limited number of users.
Unix is an open system.
Windows is closed system.
Unix is a portable o/s.
No portability
Unix provides programming facility.
No programming facility.
It is CUI.
Windows is GUI.
Unix is not user friendly.
It is user friendly.



UNIX System Organization:


·         Manned in three levels.
·         Heart of UNIX is Kernel.
·         Kernel interacts with the hardware.
·         Communication will be carried by 2nd layer which is SHELL. It is a command line interpreter.
·         Third layer is user applications.
·         Kernel generally stored in a file UNIX.

SHELL:
The shell reads your commands and interprets them as requests to execute program. Because the shell plays this role, it is a command line interpreter. Besides being a command interpreter, the shell is a programming language. As a programming language, it permits you to control how and when the commands are carried out. Shell acts as an interface between user and the kernel.
KERNEL:
The kernel is the part of the operating system that interacts directly with the hardware of a computer, through device drivers that are built into the kernel. It provides set of services that can be used by programs, insulating these programs from underlying hardware. The major functions of these programs from the underlying hardware. The major functions of the kernel are to manage computer memory, to control access to the computer, to maintain file system, to handle interrupts (signals to terminate execution), to handle errors, to perform input and output services (which allow computers to interact with terminals, storage devices, and printers), and to allocate the resources of the computer (Such as the cpu or i/o devices) among users. Programs interact with the kernel through approximately 100 system calls. System calls tell the kernel to carryout various tasks for the program, such as opening a file, writing to a file, obtaining the information about a file, executing a program, terminating a process, changing the priority of a process, and getting the time of a day.
The UNIX File system:
A file is a basic structure used to store information on the UNIX system. Before we learn any more UNIX commands it is essential to understand the UNIX file system since UNIX treats everything it knows and understands as file. All the utilities, applications, data in UNIX stored as files. Even directory can be called as a file which contains several other files. The UNIX file system resembles an upside down tree. Thus the file system begins with a directory called root. The root directory is denoted as slash (/).Branching from the root there are several other directories called bin, lib, dev, usr, temp and etc. There are three different types of files.
1. Regular /ordinary files                   2. Directory files         3.Special files
1. Regular/ordinary files:
As a user, the information that you work with will be stored as an ordinary file. Ordinary files are aggregates of characters that are treated as a unit by the UNIX system. An ordinary file can contain normal ASCII characters such as text for manuscripts or programs. Ordinary file can be created, changed, or deleted as you wish.
2. Directory files:
Directory is a file that holds other files and contains information about the locations and attributes of these other files. For example, a directory includes a list of all the files and sub directories that it contains, as well as their addresses, characteristics, file types (whether they are ordinary files, symbolic links, directories or special files), and other attributes.
3. Special files:
A special file represents a physical device. It may be a terminal, a communication devices, or storage unit such a disk drive. Special files are of two types, one is block special file—CD-Rom, printer, floppy which are unreadable format and the other is character special file—STDIN, STDOUT and STDERR which are readable format.
UNIX System Organization
/ (root) 
 
          /bin            /lib            /dev            /usr          /tmp             /etc                /var                  /home 
/ (root):  This is the root directory of the entire file system and the root directory of the super user.   
/bin:  bin stands for binary. This directory contains executable files for most of the UNIX commands. UNIX commands can be either C programs or shell programs. Shell programs are nothing but a collection of several UNIX commands.
/lib: This directory contains all the library functions provided by UNIX for programmers. The programs written under UNIX make use of these library functions in the lib directory.
/dev: This contains the special files that include terminals, printers and storage devices. These files contain device numbers that identify devices to the operating system, including:
/usr: This contains other accessible directories. Provides /usr/share/man online manual pages
/tmp: This contains all temporary files used by the UNIX system or user.
/etc: This contains system administration and configuration databases.
For example, users details, group users details etc.
/etc/passwd -> in this file you can find the users details
/etc/group -> in this file you can find the group details
/var: This contains the directories of all files that vary among systems. These include files that log system activity, accounting files, mail files that vary from system to system.
/home: This contains the home directories and files of all users. If your logname is user1, your default home directory is
/home/user1.
/root –
/sbin-

Shell
Bourne Shell (sh)
C-Shell (csh)
Korn Shell (ksh)
Bourne Again Shell(BASH)
Extended C-Shell (tcsh)

Bourne Again Shell (bash)
Bash is the shell, or command language interpreter, for the GNU operating system. The name is an acronym for “Bourne-Again Shell”. Bash is largely compatible with sh and incorporates useful features from the Korn shell (ksh) and the C shell (csh). It offers functional improvements over sh for both interactive and programming use.







No comments:

Post a Comment