Operating System

Download Report

Transcript Operating System

What is UNIX?
• UNIX is an Operating System (OS).
• An operating system is a control program that helps the
user communicate with the computer hardware.
• UNIX was developed long before Windows, about 30
years ago at AT&T Bell Labs in the US (95% written in “C”
programming language).
• UNIX was designed as an operating system for experts,
used on high-end workstations, servers and hosts.
What is UNIX?
UNIX provides some powerful features:
–
–
–
–
–
Security - private and shared files
Multi-user support
Inter-process communication
Extensive network support
Data sent to display, files, or printers in same way
• Windows NT was developed by Microsoft to try to
replace UNIX as the “OS for experts”.
Most Important Feature of UNIX
• Most important feature of UNIX: STABILITY
– 30 years to get the bugs out
– Important in shared environments and critical applications
• Shared Environments Example: University
– Windows98/NT crashes at least once a day in labs
– UNIX servers crash about once a semester
(usually due to hard disk failure)
– UNIX more than 100 times more reliable than Windows!
• Critical Applications
– Hospital - Don’t want to wait for reboot during operation!
– Airport - Air traffic control landing planes.
– Telecom - Don’t want phone system going down!
UNIX Versions
• There are two main types of UNIX:
– BSD (Berkeley Software Distribution)
– System V (developed at AT&T)
• There are many different versions of
UNIX for different hardware:
– Sun Microsystem’s Solaris (and SunOS)
– Hewlett-Packard’s HP-UX
– IBM’s AIX
– SGI’s IRIX
• Many UNIX dialects for PCs
– “Free”: Linux (distributions such as Red Hat, Caldera,Corel,
SuSE, TurboLinux, WinLinux), FreeBSD
(see http://www.linux.org/; http://www.linux.org/dist/index.html)
– Commercial: SCO UNIX (Xenix), Sun OS
PC UNIX
• Linux basically free
• Also runs well on older PCs
• Many free, reliable software & development tools
with source code e.g.,Web/Mail Server, Database
Server, File Server (NFS for UNIX, Samba for
Windows clients), Firewall, Dialup
• Extremely fast PC for hosts and servers
– Multiple (2,4,8) CPUs in one PC – Symmetric MultiProcessing (SMP)
– PC clusters for scientific computing
More powerful than and therefore alternative for older
expensive mini/mainframe & some super computers,
especially if they are running UNIX
Who Uses UNIX?
• Computer manufacturers such as
Sun, SGI, IBM, and HP
• Computer chip manufacturers
like Motorola & Intel
• Software companies
• Banks
• Hospital Authority
• Universities
• Internet Service Providers (ISP)
• Web Companies
• Web servers of many organization and for
personal use
UNIX BSD
• Berkeley Standard Distribution
(univ at CA)
• Tools:
– C shell
– VI editor
– File managers
– Network applications
Unix System V
•
•
•
•
“Standard” unix
AT&T version
Improved file sharing in the network
Version 4.0 developed by AT&T and Sun
Microsystems
X-Windows
•
•
•
•
GUI for Unix
Many tools
Standard for every system
Provides: windows, menus, buttons, dialog
boxes etc…
Applications
•
•
•
•
•
•
•
File Managers
Shells
Editors
Databases
Web Servers
Mail server
Network applications and utilities
Programming
• Many tools: compilers, debuggers etc..
• Supports: C, C++, Fortran, Pascal, Java,
Basic, Cobol, Lisp, APL, Logo, RPG
• Easy Connection between Application with
the standard input and output.
• Shell Programming
General UNIX Architecture
•
•
•
•
Hardware
Kernel
System Call Interface
Unix applications/commands
Unix File System
• What is a file system?
A means of organizing information on the
computer. A file system is a logical view, not
necessarily a physical view.
• What does the file system provide:
– Ways to create, move, and remove files
– Ways to order files
– Security
• Examples of file systems:
– DOS, Macintosh, CD-ROM, UNIX, NFS
(networked file system)
UNIX File Systems
• Hierarchical Organization
• Single root of tree is at top denoted by ‘/’
• Kinds of files:
– Directory files
/
(the branches in the tree)
– Regular files
bin
homes
lib
...
horner
jbond
...
111
top10
...
(leaves in the tree)
.mailrc
Home and Working Directories
• Home directory
– The directory you are in when you first login in
– This is your space; you control security
– Place to put your personalized ,startup files
– Your working directory after typing cd with no
arguments
• Working directory
– Can access files in your working directory by simply
typing the filename
– To access files in other directories, must use a
pathname
– pwd command prints the working directory
– cd command changes the working directory
Directory Shorthands
• “.” is the directory itself
• “..” is the parent directory
• In most shells “~” means your home
directory
• ~user means user’s home directory, so:
~jbond/.plan
• looks at the file .plan in /home/jbond,
which is jbond’s home directory.
Special Directories
• “/” (pronounced “slash” and also called “the “root”)
is the ancestor of all files in the file system
• /bin and /usr/bin contain UNIX utilities (e.g.,
cat)
• /dev contains special files which describe
“devices” such as terminals and printers
• /etc has administrative programs like password
files
• /tmp is for temporary files; periodically deleted
• Every directory has at least two entries: “.” is the
directory itself, and “..” is the directory’s parent
Naming Files
• Files in the same directory can’t have the same
name
• Case sensitive: secret and Secret are different
• Files are sometimes named with an extension
(e.g., bond.cpp, 007.html) to show the file’s
content.
• You cannot create a file named “.” or “..”
• “Invisible” files and directories (those that don’t
appear using ls) have a period as the first
character (e.g., .plan, .xinitrc). Some
programs use invisible files to store information.