Introduction to UNIX

19
Introduction to UNIX CS465

description

CS465. Introduction to UNIX. What is UNIX? (1). UNIX is an Operating System (OS). An operating system is a control program that allocates the computer's resources, schedules tasks, and helps the user communicate with the computer. - PowerPoint PPT Presentation

Transcript of Introduction to UNIX

Page 1: Introduction to UNIX

Introduction to UNIX

CS465

Page 2: Introduction to UNIX

What is UNIX? (1)

• UNIX is an Operating System (OS).

• An operating system is a control program that allocates the computer's resources, schedules tasks, and helps the user communicate with the computer.

• Most popular PC operating systems: Windows 95/98/2000/XP -- proprietary, single-user OS

• UNIX was developed long before Windows, about 30 years ago at AT&T Bell Labs (95% written in “C” programming language).

Page 3: Introduction to UNIX

What is UNIX? (2)

• UNIX was designed as an operating system for experts, used on high-end workstations, servers and hosts.

• UNIX provides some powerful features:

– Interactive, multi-user support

– Security - private and shared files

– Inter-process communication

– Extensive network support

Page 4: Introduction to UNIX

History of Unix• 1970-1974

– Early stages, developed on PDP-11 machines– Unix is not an acronym, but a weak pun on MULTICS

• 1976, first licensed release, Version 6• 1978, first portable version, Version 7• 1979, Berkeley 3 BSD• 1983, System V as industry standard• 1984, Microsoft releases Xenix• 1986, BSD 4.3, AT&T Version 9• 1987, SVR4, Mach, …• 1993, Linux

Page 5: Introduction to UNIX

UNIX Compared with other OS• Mature and stable OS

• Large user community

• Vendor-independent OS

• Network-portable window system (X)

• Runs on range of hardware (PC - Cray)

• Common Open System Environment (COSE)– Source code is available to view and modify

Page 6: Introduction to UNIX

Multi-user, Multi-tasking• More than one user can run at the same time and each

user can run more than one task at the same time

• In Unix, each program is started as a process.

– A process is a program in execution.

• Usually only one copy of a program, but there may be many processes running the same program.

• Each interactive user may have:

– only one process in foreground

– may have several processes in background

Page 7: Introduction to UNIX

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– Windows 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!

Page 8: Introduction to UNIX

UNIX Versions • Two main types of UNIX:

– BSD (Berkeley Software Distribution)/OSF– System V (developed at AT&T) our book

• Different versions of UNIX for different hardware:– Sun Microsystem’s Solaris (and SunOS)– Hewlett-Packard’s HP-UX– IBM’s AIX– SGI’s IRIX

Page 9: Introduction to UNIX

Cornerstones of the Unix Philosophy

1. Clean minimal design (nothing unnecessary)

• Make each program do one thing well.

2. Combine existing utility programs to perform more complex tasks, and allow users to build their own utility programs. 

3. Use terse commands and messages to reduce typing and screen output.

4. Allow users to select what command language they will use (shell selection).

Page 10: Introduction to UNIX

Additional Unix Philosophy

6. Make file, device, and interprocess I/O compatible.

- All three are treated like files

7. Open access:

- Minimal restrictions to the ways of doing things

- User can be very creative (and frustrated).

8. Major parts of the Unix OS:

- Kernel

- Shell

- File System

Page 11: Introduction to UNIX

Unix Operating System Structure• OS mediates between the user and the

computer User

Application Programs

Kernel

Hardware

Shell

Page 12: Introduction to UNIX

The Unix Kernel

• Loaded at system startup (boot up) and is memory-resident

– Directly controls the hardware

• Manages all devices

– Schedules work done by the CPU

– Manages memory and allocates it to each process

• Gets instructions from shell and carries them out

• Enforces access permission on the file system

Page 13: Introduction to UNIX

The Shell• Command interpreter

– To get your work done, you enter commands at the shell prompt

– Can edit the command line

– Shell interprets the command and passes it to the kernel for execution

• Allows you to create a customized environment

• Stores and allows manipulation of command history

• Used to write shell scripts

Page 14: Introduction to UNIX

Shells (1)

• Bourne Shell: the default shell (sh)– original Unix shell, written by Steve Bourne

– does not have interactive features of newer shells

– widely used for writing shell scripts

– available on ALL Unix systems

• C Shell (csh): originally written for BSD – with syntax similar to the C language

– with many enhancement over the Bourne shell.

Page 15: Introduction to UNIX

Shells (2)• Korn Shell (ksh): AT&T’s answer to C Shell

– Superset of the Bourne shell– Also includes many C shell features– very efficient, written by Dave Korn

• TC Shell (tcsh)– Superset of C shell with EMACS-like command line

editing

• Bourne Again Shell (bash)– Public domain shell written by the Free Software

Foundation

Page 16: Introduction to UNIX

Why has Unix been successful?•  UNIX is portable, because it was written in C.

– Provides hardware independence.

• Open System

– Underlying operating system source code is available

•  Provides a productive environment

– Allows multi-tasking and sharing of data

– Excellent C development environment is built-in

– Networking capabilities are built in

Page 17: Introduction to UNIX

Unix Disadvantages UNIX is not as user-friendly as some operating

systems– Command names are often cryptic– User help is not great

UNIX does not error check user commands to protect users from hurting themselves or the system– Example: Request to copy a file over an existing

file will overwrite the existing file with no warning.

Page 18: Introduction to UNIX

Unix Disadvantages

UNIX is less secure than some operating systems– Developed to be used as a software development environment,

in which all users are working together cooperatively. Security was traded for more convenience and flexibility.

– Well-documented open code makes hacking easier.

UNIX's portability also makes it less efficient on any particular hardware.– Proprietary operating systems are optimized for that hardware.

Page 19: Introduction to UNIX

I hope that you will decide that

Unix’s advantages

outweigh

its disadvantages!