Revision no.
: PPT/2K403/02
Introduction to UNIX
Revision no.: PPT/2K403/02
History of UNIX
• A group of computer scientists from Bell Labs and GE in 1965
joined in an effort underway at MIT on Multics (Multiplexed
Information and Computing Service) mainframe timesharing
system.
• Bell Labs withdrew from the effort in 1969 but Ken Thompson,
Dennis Ritchie, Doug McIlroy, and J. F. Ossanna continued
their efforts at Bell Labs Computing Science Research Center.
• Ken Thompson & Dennis Ritchie wrote a computer game
called "Space Travel" game for the PDP-7 machine which had
an excellent display terminal.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
History of UNIX (contd.)
• Initial implementation was totally rewritten in a form that
looked like an operating system, with tools that were sort of
known like assembler, editor, shell etc.
• In 1970 Brian Kernighan suggested the name 'UNIX,' for this
implementation in a somewhat treacherous pun on 'Multics.‘
• First potential customer was the Bell Labs Patent Department,
which was evaluating a commercial system to prepare patent
applications.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
History of UNIX (contd.)
• First version of UNIX was written in assembler language which
was later written in Higher Level Languages.
• UNIX-based systems are sold today by a number of companies
which include Solaris from Sun Microsystems, HP-UX from
Hewlett-Packard, AIX from IBM, and Tru64 UNIX from Compaq.
• There are also many freely UNIX-compatible implementations,
such as Linux, FreeBSD and NetBSD.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Kernel
• The UNIX kernel is the heart of the Operating system.
• The kernel directly controls the hardware.
• It controls functions like File Management and Security,
Input/Output services, Memory Management, Process
Scheduling and Management, System accounting. Interrupt
and error handling, and also Date and time services.
• Besides this, it also ensures an interaction without conflict
between physical resources like the processor, memory and
the peripherals and well as the software processes and files.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Shell
• It acts as a command
interpreter for the commands
input by the user.
• The shell takes the user
commands as input,
processes them into suitable
system calls to interact with
the kernel which in turn
interacts with the hardware to
perform the task.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Shell (contd.)
• The shell does not interact directly with the hardware.
• The shell has some basic commands which are directly
understandable by it.
• Unix shell is responsible for executing the shell scripts which
use the programming language of the shell.
• The shell has a programming language with in-built logical
looping and testing constructs, which enable the users to
create their own programs.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Features of UNIX
• Multitasking OS:-
– Processing more than one job at a time managed by dividing the
CPU time intelligently between all processes being carried out.
• Multi-User OS :-
– UNIX allow several users to work on the computer system at the
same time.
– The users can sign on the system through multiple terminals
connected to a host computer.
– To provide a multi-user environment UNIX uses the time-sharing
method.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Features of UNIX (contd.)
• Multi-threading :-
– In UNIX a task is divided into multiple sub-tasks called as threads.
– Each sub-task is given to a CPU, hence all these sub-tasks are
executed simultaneously.
– At the end of execution of these sub-tasks, they are linked
together to give the final output.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Features of UNIX (contd.)
• Portability:-
– The ability of software that operates on one machine to operate as
efficiently on another different machine, without making major
changes to the software is termed as portability.
• Modularity:-
– The modular design of the OS allows various parts of the UNIX
system to be added or removed according to the users
requirements without affecting the performance of other
components.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Features of UNIX (contd.)
• System Security:-
– UNIX being a multi-user operating system offers protection of one
user's information from another.
– It maintains a list of users who are allowed to access the system.
– It also keeps track of what files and resources each user is
authorized to use.
– UNIX has a hierarchical file structure.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Features of UNIX (contd.)
• I/O Redirection & Piping:-
– UNIX commands are designed in such a way that they take input
from a conceptual file called the Standard Input (usually the
keyboard) and send their output to another conceptual file called
the Standard Output (usually the VDU or the monitor).
• Programming Facility:-
– The UNIX shell has all the necessary things like control
structures, loops and variables which establish it as a
programming language
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Features of UNIX (contd.)
• UNIX has built-in networking:
– Most of the UNIX flavors implements Centralized computing. You
can also used UNIX for Distributed computing.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Difference Between DOS & UNIX
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Process and Runlevels
• Process:
– A process simply is an instance of a running program.
• Run Levels:
– Each Unix vendor defines a number of arbitrary run levels which
correspond to a certain system state.
– When the system is in a certain run level, only a specified group
of system processes can exist.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Login Procedure
• Login
– This command is necessary for getting and controlling access to
your UNIX system. Whenever the terminal is turned on, the system
displays the following message.
CMS
Welcome to SCO System V/386
login :
– Here the user has to type in the login name and press the <Enter>
key after that.
Login : cms (user name)
Password :
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Login Procedure (contd.)
• If the login or the password is invalid or typed with an error, a
message Login incorrect is displayed and another login
prompt is displayed.
login : cms
password :
login incorrect
login :
$logout/exit
Format : logout/exit
Purpose : to exit from the system
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Unix File System
• Unix treats everything it knows and understands, as a file.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Unix File System (contd.)
• Root directory is denoted as slash (/) and branching from the
root there are several other directories called bin, lib, usr, etc,
tmp and dev.
Directory Contains
bin Binary executable files
lib Library functions
dev Device related files
etc Binary executable files usually required
for system administration
tmp Temporary files created by Unix or user
usr Home directories of all users
/usr/bin Additional binary executable files
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Unix File System (contd.)
• It has a hierarchical file structure.
• Files can grow dynamically
• Files have access permissions.
• All devices are implemented as files.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Unix File System (contd.)
• Disk space allotted to a Unix file system is made up of 'blocks'
and each of which is typically of 512 bytes.
• File systems may have blocks of 1024 or 2048 bytes as well but
block size rarely exceeds 2048 bytes.
• All the blocks belonging to the file system are logically divided
into four parts.
– Boot Block
– Super Block
– Inode Table
– Data Block
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Home Directory and Path Names
• UNIX system always associates each user of the system
with a particular directory.
• You are placed automatically into a directory called your
HOME directory when you log into the system.
• A path name enables you to uniquely identify particular files
to the UNIX system.
• A path name that begins with a slash character is known as
a full path name.
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K403/02
Design & Published by:
CMS Institute, Design & Development Centre, CMS House, Plot No. 91, Street No.7,
MIDC, Marol, Andheri (E), Mumbai –400093, Tel: 91-22-28216511, 28329198
Email: courseware.inst@cmail.cms.co.in
www.cmsinstitute.co.in
© CMS INSTITUTE, 2004. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute