Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Notes1

Getting familiarized with UNIX

By now I hope that all of you have worked on a computer at least once, and also
assume that most of you would be familiar with the Windows Operating System
(OS). In this document, we are going to acquaint ourselves with the Unix OS
under the following headings.

1. History
2. Unix Components
3. Users
4. File System Architecture

History

The Unix operating system found its beginnings in MULTICS ( Multiplexed


Operating and Computing System). The MULTICS project began in the mid
1960s as a joint effort by General Electric, Massachusetts Institute for
Technology and Bell Laboratories. In 1969 Bell Laboratories pulled out of the
project.

One of Bell Laboratories people involved in the project was Ken Thompson. He
liked the potential MULTICS had, but felt it was too complex and that the same
thing could be done in simpler way. In 1969 he wrote the first version of Unix,
called UNICS. UNICS stood for Uniplexed Operating and Computing System.
Although the operating system has changed, the name stuck and was eventually
shortened to Unix.

Ken Thompson teamed up with Dennis Ritchie, who wrote the first C compiler. In
1973 they rewrote the Unix kernel in C. The following year a version of Unix
known as the Fifth Edition was first licensed to universities. The Seventh Edition,
released in 1978, served as a dividing point for two divergent lines of Unix
development. These two branches are known as SVR4 (System V) and BSD.

Ken Thompson spent a year's sabbatical with the University of California at


Berkeley. While there he and two graduate students, Bill Joy and Chuck Haley,
wrote the first Berkely version of Unix, which was distributed to students. This
resulted in the source code being worked on and developed by many different
people. The Berkeley version of Unix is known as BSD, Berkeley Software
Distribution. From BSD came the vi editor and C shell.
The Linux operating system was developed as a Unix look alike and borrows
from both BSD and SVR4.

UNIX Components

Figure 1 depicts the high-level architecture of the UNIX system components.

Figure 1 Architecture of UNIX Systems

Here there are 3 distinct layers of software.

Kernel - The kernel of UNIX is the hub of the operating system: it allocates
time and memory to programs and handles the file storage and
communications in response to system calls. It interacts directly with
hardware.

As an illustration of the way that the shell (sh) and the kernel work together,
suppose a user types rm myfile (which has the effect of removing the file
myfile). The shell searches the file storage for the file containing the program
rm, and then requests the kernel, through system calls, to execute the
program rm on myfile. When the process rm myfile has finished running, the
shell then returns the UNIX prompt $ to the user, indicating that it is waiting
for further commands.

System Utilities – These programs interact with the operating system on


behalf of the user. They provide an easy way to perform common activities.
For example, Notepad, is a text editing utility, provided by Windows OS, that
helps users to type and save text documents. Similarly UNIX provides users
with editors like vi and ed. Another example is shell.

Shell - The shell acts as an interface between the user and the kernel. When
a user logs in, the login program checks the username and password, and
then starts another program called the shell. The shell is a command line
interpreter (CLI). It interprets the commands the user types in and arranges
for them to be carried out. The commands are themselves programs: when
they terminate, the shell gives the user another prompt ($ on the linux
server).

Most shells have the features for

Automatic Filename Completion – By typing part of the name of a command,


filename or directory and pressing the [Tab] key, the shell will complete the
rest of the name automatically. If the shell finds more than one name
beginning with those letters you have typed, it will beep, prompting you to
type a few more letters before pressing the tab key again.

History - The shell keeps a list of the commands you have typed in. If you
need to repeat a command, use the cursor keys to scroll up and down the list
or type history for a list of previous commands.

Application Programs – These programs are built on top of lower level


programs.

cc – this is used for compilation of c programs. Like, Turbo C is used for


editing, compilation and execution of programs. cc, invokes the C
preprocessor, two-pass compiler, assembler and loader, all these are
separate low level programs.
Users

To assure secure access to files, UNIX has the concept of different users and
groups. Each user of a UNIX system has a user id, group id and a
corresponding password. By default, a user has permission to, read, write and
execute programs created or owned by him. These permissions are also called
as access rights. A user usually has restricted access over other files in the
system, as determined by the system policy.

Root or Administrator

Root or Administrator is a special user. This user is concerned with, creating


more users and installation of software. Software are usually installed in
/usr/local directory. He can also write and modify any file on the system.

Groups

Groups are collection of users. This concept is useful when a sub-set of


users hae to be permission to access some data.

File System Architecture

The UNIX file system is characterized by

• A hierarchical structure.
• The ability to create and delete files. ( Unlike Windows there is no
concept of recycle bin in UNIX, a file once deleted can not retrieved.
Hence be careful when deleting files.)
• The treatment of peripheral devices (such as terminals and tape units) as
files.

The file system is organized as a tree with a single root directory called as root (
written as “\”), every non-leaf node is a directory and every leaf node is either a
directory or a file. The name of a file is given by a path name that describes how
to locate the file. The path name is a sequence of component names separated
by the slash “\” character. Figure 2 shows an example file system tree.
Figure 2 Sample File System Tree

Here the full or absolute path name for the directory cprogs is
/home/mary/cprogs. Similarly for date the path is /etc/date. The path name
can also start from the current directory. For example mary/cprogs, is a valid
directory from within home.

Creation of files can be done ways in UNIX. For example, for writing
programs, vi editor may be used. For removal of files, rm command is used.

In UNIX file is treated as a byte stream, and is up to the program to utilize


the content. Even peripheral devices, like output to monitor and input from
keyboard are present in files.

References:

1. http://www.uwsg.iu.edu/UAU/intro/history.html
2. http://www.ee.surrey.ac.uk/Teaching/Unix/unixintro.html
3. M. J. Bach, The Design of the Unix Operating System, Prentice Hall India.
4. B. W. Kernighan, R. Pike, The UNIX Programming Environment, Prentice
Hall India.

You might also like