0% found this document useful (0 votes)
14 views31 pages

Ch1.IntroductionToUNIX 31

The document provides an introduction to the UNIX operating system, detailing its history, features, and functionalities. It covers key concepts such as multitasking, multiuser environments, and the role of the kernel, as well as the importance of application programming interfaces (APIs) in system programming. Additionally, it outlines the UNIX file hierarchy and the significance of system administration in managing user access and system resources.

Uploaded by

viptaha.2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views31 pages

Ch1.IntroductionToUNIX 31

The document provides an introduction to the UNIX operating system, detailing its history, features, and functionalities. It covers key concepts such as multitasking, multiuser environments, and the role of the kernel, as well as the importance of application programming interfaces (APIs) in system programming. Additionally, it outlines the UNIX file hierarchy and the significance of system administration in managing user access and system resources.

Uploaded by

viptaha.2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

CYS492 Selected Topics (2)

The UNIX Operating System


and System Administration

Prepared by:
Dr. Adnan
Rawashdeh
Chapter-1:
Introduction to UNIX

Prepared by: Dr. Adnan Rawashdeh


Ref. UNIX Lecture Notes –Prof. Stewart Weiss
Dennis Ritchie, 1941 – 2011 said:
• “UNIX is basically a simple operating system,
but you have to be a genius to understand
the simplicity.”
Overview
• UNIX falls under two major categories:
1. Unix System V, created by AT&T Bell Labs in 1969
(Thompson & his team)
2. Berkeley Software Distribution (BSD), Developed
and reproduced in 1978 by the University of
California at Berkeley (worked on Sun
workstations). It included enhancement to make
UNIX user – friendly.
• Later on, Unix V Release 4 combined the two and
since then, it was considered the Standard UNIX
System. After that Unix V-R4.2 came with GUI
(Graphical-User-Interface).
Why it is important to select the right OS?
• Application programs coded to run under a
particular OS.
• Features varies among OSs.
• Each OS uses a specific format when
transferring data, so that, one OS may not be
able to read disks created by another OS.
 Unix becomes the most popular OS today, may
be because of its capabilities.
Working with Unix
There are two ways to work with Unix:
• Using the GUI System (eg. As in Unix V R4.2)
• From the Command Line.

 In order to be able to work with Unix you need a


"USERNAME" and a "PASSWORD".
 The person who sets this information called the
System Administrator (Sys. Admin. for short).
Unix Features
1. Multitasking (also Known as Multiprocessing):
Ability of running several applications at the same time
(simultaneously). Actually what happen in very short
time? In Unix this feature is done even differently
How?
Unix monitors processes "Waiting to run”, as well as those
currently running, and schedules each process to have
equal access to the microprocessor. The result is that
open applications appear to be running concurrently.
 Question: What is the difference between
“Multitasking/Multiprocessing and “Parallel processing”.
2. Multiuser Environment
• Multiuser: many users, simultaneously, each running
one or more applications.
• More than one user could be using the same
application. This is different from updating a certain file
by several users.

• QUESTION: How we can prevent accessing the same


RECORD by more than one user simultaneously?
• ANSWER: Record –Locking – Mechanism is usually
used, or Synchronization.
3. Programmable Shell
• It is used to personalize (customize) the O.S
environment in order to make it easy and
user-friendly.
• For example we can write a shell to run a
backup process that would take a lot of time if
we had to do it in the traditional way
(manually).
Environment Variables
• We can view and set the environment variable.
• They are used to control the default behavior of the processing.
• They refer to things like Name of your Shell, Your Home-Directory and
Type of your Terminal.
• Type env command with no arguments.
• The output formatting depend on which shell you are using. A typical
environment looks:
• $ env <RT>
___________________output______________
• HOME=/u/sartin
• LOGNAME=sartin
• MAIL=/usr/mail/sartin
• MANPATH=/usr/man:/usr/contrib/man:/usr/local/man
• PATH=/bin/posix:/bin:/usr/bin:/usr/contrib/bin:/usr/local/bin
• SHELL=/bin/sh
• TERM=vt100
To see the value of an environment variable:
Example: Home environment variable:
$ echo $HOME
• /u/sartin

• Possible Values to Set Some environment variables:


PS1=prompt [PS1="Enter Command"]
HOME=/home/login [HOME = /home/adnan]
PATH = path-name [PATH= usr: /
binysr/local/bin]
TERM= terminal-type [TERM= vt10.0]
4. Device Independent
• Each device (such as a Printer, Modem, or
Terminal) is viewed as a separate file (special
kind of files). Unix makes a link to the Kernel
for each new device. It allows users to use
devices and files interchangeable.
5. Open Systems Portability
• Portability means the ability to transfer an OS
from one platform (hardware type) to another
so that it still performs the way it should.
• Eg. Unix Main-Frame and Unix-Workstations.
6. Communication and Network,
• Unix has excellent capabilities in communications
and networking services. Traditional services:
– Finger, and e-mail.
– Remote access protocols: rlogin/telnet, ftp,
– Nowadays we have: Secure Shell (SSH), and Secure
copy (SCP)
– Learn more using the following video links:
https://www.youtube.com/watch?v=Atbl7D_yPug
https://www.youtube.com/watch?v=2u0I-U0D7Uk
7. Error Handling
• Accidental change/deleting of files (fixed by
Permissions).
• Interrupt handing (eg. Ctr-C stops running jobs)
• Segmentation violation is prevented.
• Panic status (Unix saves info. & status-info, and
quits).
8. Special Tools
 The pipe ( | ) allows to combine several commands.
 The ( &) allows to run processes in the background.
Applications Vs OS
• A modern software application typically needs to
manage both private and system resources.
– Private resources are its own data, such as the values of
its internal data structures.
– System resources are things such as files, screen
displays, and network connections. In addition, sub-
processes and threads.
• Modern operating systems (OSs) prevent
application software from managing system
resources directly, instead providing interfaces that
these applications can use for managing such
resources.
Application Programming Interface (API)

• For an application program to use a computer


screen or read/write to a file; it must use the
interface that the OS defines.
• The interface provided by an OS for
applications to use when accessing system
resources is called application programming
interface (API).
System Programs
• The program that uses these system level
services directly is called a system program.
• The type of programming that uses these
services is called system programming.
• Thus, System programs make requests for
resources and services directly from the OS
and may even access the system resources
directly.
About API
• An API typically consists of a collection of
function, type, and constant definitions, and
sometimes variable definitions as well.
• The API of an OS in effect defines the means
by which an application can utilize the services
provided by that OS.
• Programmers need to master the system level
services defined in the API of the OS that they
use when they build applications.
The Kernel
• The kernel is the Core part of the OS.
• The kernel interacts directly with the
computer hardware. Its major functions:
– Managing memory,
– Controlling access to the computer,
– Handling the file system,
– Handling interrupts and errors,
– Performing I\O services and
– Allocating computer resources, such as CPU time,
among processes.
Computer-System Layers & Interfaces
Detailed Layers
C program using simple I/O model
# include <stdio.h>
/* Copy from stdin to stdout until end-of-file*/
int main ( )
{
int c;
while ( ( c = getchar( ) ) != EOF )
putchar( c ) ;
return 0;
}
C++ program using simple I/O model
# include <iostream>
Using namespace std;
/* Copy from stdin to stdout until end-of-file*/
int main ( )
{
char c;
while ( ( c = cin.get( ) ) && !=cin.eof() )
cout.put( c ) ;
return 0;
}
Single-user PC
• These programs give us the illusion that they
are directly connected to the keyboard and
the display via C library functions getchar()
and putchar() and the C++ iostream member
functions get() and put().
• On a PC running in single-user mode, this
illusion is not far from reality in the sense that
the keyboard is indirectly connected to the
input stream of the program, and the monitor
is indirectly connected to the output stream.
 But; this is not the case in a multi-user system.
Multi-user Shared System
• In a multi-user OS, several users may be
logged in simultaneously, and programs
belonging to different users might be running
at the same time, each receiving input from a
different keyboard and sending output to a
different display.
Cornerstones of UNIX
• The Design of the File System (File Hierarchy)
• Process Concept,
• The Concept of Privileged and unprivileged
programs,
• The concepts of user and groups,
• A programmable shell,
• Environments, and
• Device independent input and output.
Processes
• A running program in Unix is called a "process“.
• In Multitasking, where many processes running
simultaneously, Unix distinguishes between them by
assigning a UNIQUE-ID number for each new process
introduce to the system.

• Every process in Unix is created with THREE default


files:
(i). Standard Input (Keyboards)
(ii). Standard Output (screen)
(iii). Standard Error (Messages)
Background Processes
• Some processes are actually running on the
system (live), but from a user perspective, they
cannot be seen, these are known as
background processes.
• There are background system processes, and
background user processes; these can be
created by Unix user.
• How?
 If you place the & (ampersand) symbol at the
end of a command it will run concurrently
with the shell in the background.
The File Hierarchy in UNIX
Directory and Purpose
• bin The repository for all essential binary executables including those shell
commands that must be available when the computer is running in "single-
user mode" (something like safe mode in Windows.)
• boot Static files of the boot loader.
• dev The directory containing essential device files, which will be explained
later.
• etc Where almost all host configuration files are stored. It is something like
the registry file of Windows.
• home The directory where all user home directories are located, but not
always.
• lib Essential shared libraries and kernel modules.
• media Mount point for removable media.
• mnt Mount point for mounting a file system temporarily.
• opt Add-on application software packages.
• sbin Essential system binaries.
• srv Data for services provided by this system.
• tmp Temporary files.
THANK YOU!

You might also like