Overview of UNIX.

Slides:



Advertisements
Similar presentations
Configuration management
Advertisements

Operating System Structures
Chap 2 System Structures.
Operating Systems - Introduction S H Srinivasan
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
What is Unix Prepared by Dr. Bahjat Qazzaz. What is Unix UNIX is a computer operating system. An operating system is the program that – controls all the.
CS240 Computer Science II Introduction to Unix Based on “UNIX for Programmers and Users” by G.Class and K. Ables.
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
Operating Systems.
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
CS 390 Unix Programming Environment Summer Suchindra Rengan - CS3902 Course Details Instructors Suchindra Rengan – ‘sachin’ ( Section 001)
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Operating System What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. An operating.
CS2204: Introduction to Unix January 19 th, 2004 Class Meeting 1 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Basic UNIX Concepts. Why We Need an Operating System (OS) OS interacts with hardware and manages programs. A safe environment for programs to run is required.
Introduction to UNIX CS 2204 Class meeting 1 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Introduction to UNIX CS465. What is UNIX? (1) UNIX is an Operating System (OS). An operating system is a control program that allocates the computer's.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
CEG 2400 FALL 2012 Linux/UNIX Network Operating Systems.
WHY AN OPERATING SYSTEM (OS) OS interacts with hardware and manages programs. Programs not expected to know which hardware they will run on. Must be possible.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
UDel CISC361 Study Operating System principles - processes, threads - scheduling - mutual exclusion - synchronization - deadlocks - memory management -
1 OPERATING SYSTEMS. 2 CONTENTS 1.What is an Operating System? 2.OS Functions 3.OS Services 4.Structure of OS 5.Evolution of OS.
CSCE451/851 Introduction to Operating Systems
Copyright © 2003 by Prentice Hall 1 Computers: Tools for an Information Age Chapter 3 Operating Systems: Software in the Background BSM025 Computers.
Introduction to Operating Systems Concepts
Computer System Structures
Computer System Structures
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
A LECTURE NOTE.
Operating System & Application Software
Unix Scripting Session 1 March 6, 2008.
2. OPERATING SYSTEM 2.1 Operating System Function
Credits: 3 CIE: 50 Marks SEE:100 Marks Lab: Embedded and IOT Lab
Operating System.
Popular Operating System Chapter 8
Operating System Structure
COSC 350 System Programming
Introduction to Operating System (OS)
What is an Operating System?
Chapter 2: Operating-System Structures
Chapter 2: The Linux System Part 2
Chapter 2: System Structures
Chapter 2: The Linux System Part 1
Software models - Software Architecture Design Patterns
Lecture Topics: 11/1 General Operating System Concepts Processes
Introduction to Operating Systems
Operating Systems : Overview
Introduction to Operating Systems
Chapter 2: Operating-System Structures
Operating Systems Lecture 3.
Operating Systems : Overview
Introduction to Computer Programming
Operating Systems : Overview
Linux Professor Sabol.
Operating Systems : Overview
Chapter 2: Operating-System Structures
Outline Operating System Organization Operating System Examples
System calls….. C-program->POSIX call
Section 1: Linux Basics and SLES9 Installation
Chapter 1 What is UNIX? Graham Glass and King Ables,
Chapter-1 Computer is an advanced electronic device that takes raw data as an input from the user and processes it under the control of a set of instructions.
Chapter 2: Operating-System Structures
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

Overview of UNIX

Course Organization (This lecture is in red) Part I: Unix System Programming (Device Driver Development) Part II: Compiler Design Character Device Driver Development (HW #2) Introduction to Block Device Driver Syntax Analysis (HW #4) Overview of Device Driver Development Lexical Analysis (HW #3) Process & File (HW #1) Overview of Complier Design Overview of Unix Sys. Prog. Overview of the Subject (COMP 3438)

Topics Introduction to system software Unix System programming UNIX programming basics Unix file system and processes Unix device driver development Principles of compiler construction Syntax and semantics of programming languages Lexical analysis Syntax analysis Code generation and optimization

What is Unix? UNIX is a family of general purpose operating systems (OS) Originally developed at AT&T Bell Laboratories. Can be easily adapted to run on different computers - has been available on a wide range of hardware UNIX has become a key part of technology landscape. A huge number of large-scale data management and transaction-processing systems, computer aided design, manufacturing control  systems, laboratory simulations are built on UNIX platforms UNIX is the core of the server backbone of the Internet - the Internet itself began life with UNIX. Today, without UNIX systems, the Internet would come to a screeching halt. Most telephone calls could not be made, electronic commerce would grind to a halt

What makes up Unix? UNIX is more than an OS - it also contains other components

Interrupt and Error Handling Unix kernel The kernel is the core of the UNIX OS controls the hardware and performs various low-level functions; A collection of software modules that run in privilege mode (full access to system resources) Other parts of the UNIX system, as well as user programs, request the kernel for various services through system calls . A system call is an entry point directly into the kernel. Unix OS File Management and Security Device Management; Interrupt and Error Handling Date and Time Services System Accounting UNIX System Kernel Process Scheduling & Management Memory Management Inter-Process Communication

Making use of system calls and library functions Programs request UNIX OS kernel services by invoking an appropriate system call. Programs may also utilize many general-purpose C library functions Distinction between system calls and library functions? Both are routines that can be invoked by a user program. Library functions may or may not invoke system calls. System calls run in kernel mode, while library functions run within user’s space.

Unix utilities UNIX also encompasses a broad set of commands, called utilities An environment for software development, text processing, communication, accounting, language processors, databases, etc. Not part of the OS kernel, but a host of supporting programs provided along with the OS. Using UNIX utilities, other system/application programs can be developed - once installed on a UNIX system, these programs are indistinguishable from UNIX utility commands. Utility programs are accessed through the Shell

Unix shell The shell is the powerful command interpreter for UNIX - accepts user commands and is responsible for seeing that they are carried out. The shell itself is a command that acts as an interface between the user and the OS kernel. Each user has a separate shell program, so UNIX handles several shells concurrently.

Hardware Interfaces (Device Drivers) y s t e m o f w a r T o o l s Shell File system Compilers & Libraries Databases Editors Document processing System Call Interface OS Network Extensions OS Kernel Other Extensions Hardware Interfaces (Device Drivers) The hardware interfaces are the only parts of the OS which are machine dependent. They connect the machine-independent parts above them to the specific hardware details and support the use of these machine-independent parts on many different hardware machines - this makes it possible to easily re-implement the OS on different hardware architectures.

Features of Unix Portability Multi-user Operation Multitasking Processing Hierarchical File System Powerful Shell Pipes Networking Robustness In UNIX, several people could be using the computer at the same time. It appears to each user that the computer is executing instructions solely on his or her behalf. The ability of a single computer with a single CPU to execute several programs simultaneously is known as multiprogramming. The computer system executes , perhaps, several thousand instructions of one user’s program, then suspend execution of that program and switches to another user’s program. By regularly switching from one user to another (called time-slicing), each user has the illusion that his or her program is continuously executing. As more users sign on to the system, programs receive time slices less often and the illusion of continuous execution may begin to break down. The UNIX system actually allows each user to have several simultaneously executing programs. There are two ways: 1) Use the shell command language: start up the first program as a background job, and then issue the second program 2) including the fork system function call inside a C program

Unix is portable The UNIX system, as well as the software written for UNIX, is portable to many different machine architectures. UNIX has been installed on many kinds of computers from different vendors. This is due its hierarchical and modular structure, and also its use of the C programming language. In UNIX, several people could be using the computer at the same time. It appears to each user that the computer is executing instructions solely on his or her behalf. The ability of a single computer with a single CPU to execute several programs simultaneously is known as multiprogramming. The computer system executes , perhaps, several thousand instructions of one user’s program, then suspend execution of that program and switches to another user’s program. By regularly switching from one user to another (called time-slicing), each user has the illusion that his or her program is continuously executing. As more users sign on to the system, programs receive time slices less often and the illusion of continuous execution may begin to break down. The UNIX system actually allows each user to have several simultaneously executing programs. There are two ways: 1) Use the shell command language: start up the first program as a background job, and then issue the second program 2) including the fork system function call inside a C program

Unix supports multi users UNIX is a multi-user system- several people could be using the computer at the same time. Uses "time-sharing " maintains a "queue” of tasks waiting to be done and shares the available CPU time among these tasks by assigning time quantum to them. Allows efficient sharing of resources, while offering the security and protection features needed to insulate each user from the activities of other users. In UNIX, several people could be using the computer at the same time. It appears to each user that the computer is executing instructions solely on his or her behalf. The ability of a single computer with a single CPU to execute several programs simultaneously is known as multiprogramming. The computer system executes , perhaps, several thousand instructions of one user’s program, then suspend execution of that program and switches to another user’s program. By regularly switching from one user to another (called time-slicing), each user has the illusion that his or her program is continuously executing. As more users sign on to the system, programs receive time slices less often and the illusion of continuous execution may begin to break down. The UNIX system actually allows each user to have several simultaneously executing programs. There are two ways: 1) Use the shell command language: start up the first program as a background job, and then issue the second program 2) including the fork system function call inside a C program

Unix supports multi-tasking UNIX is a multitasking system - even for a single user, time-sharing still goes on. First, UNIX has some programs, such as system-wide accounting programs, that automatically run from time to time. Second, UNIX supports background processing, which allows a user to initiate a task "in the background" and then proceed to other activities. So, UNIX time-shares between the immediate command and background jobs. Third, UNIX allows the creation of new tasks in a program by including appropriate function calls.

Unix has a hierarchical file system UNIX files are organized into separate directories Directories are themselves organized into a tree-like structure. There is one master directory, called the root directory, from which various sub-directories branch off. The hierarchical structure offers a maximum flexibility for grouping information in a way that reflects its natural structure. A single user's data may be grouped by activity; Data from many different users can be grouped according to corporate organization. As a result, stored data is easier to locate and manage.

Unix shell is powerful The shell supports a number of convenient features, such as redirection of application input and output, e.g. % ls > myfiles the ability to manipulate groups of files with a single command. executing a sequence of commands stored in a text file, called a "shell script", allowing us to build our own commands which may be parameterized. being used as a programming language that provides string-valued variables and control flow primitives including branching and iteration.

Unix’s pipe is novel One of the most famous UNIX features A pipe passes the standard output of one command directly to another command, to be used as its standard input. % who | sort Allows any number of commands to be connected in a sequence, and automatically handles the data flow from one program to the next % who | sort | lp Produces the same effect as if one large program, rather than several small ones, had been executed. allowing the combination of several simple programs to perform more complex functions eliminating the need for new software development.

Unix supports networking Networking support is built into the UNIX system Supports TCP/IP protocols, and provides a new OS abstraction, the socket, that allows application-level programs to access the Internet. The socket abstraction acts as an interface between application level programs and the underlying TCP/IP protocols.

Unix is robust When encounter an error, a UNIX program does not abort. Instead, the program returns a value indicating an error condition, and it is up to the program to check for the error and handle it. Typically, a return error value is negative if the return type is int, or a NULL if the return type is a pointer. The C library function perror() outputs a message string to standard error file followed by the error message from the last system or library call that produced an error

/* Example */ The open system call #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int fd; if ((fd = open("my.file", O_RDONLY)) == -1) perror("Unsuccessful open of my.file"); The following output might be produced if my.file does not exist Unsuccessful open of my.file: No such file or directory

History of Unix Two major families of UNIX implementations: System V : evolved from the original AT&T UNIX. BSD (Berkeley Software Distributions) UNIX Both are merging now

System V - had gone through 10 The very first version of UNIX Developed at AT&T Bell Lab in 1969 by Ken Thompson. Later, Dennis Ritchie joined and he invented the C language in which later versions of UNIX are written. - had gone through 10 editions now System V was released from AT&T (Western Electric) in 1983 as a standard, and since then has gone through several releases, including V2.2, V3, V3.1, V3.2. V4 (latest release by USL)

BSD Unix First developed by a graduate student, Bill Joy, in 1977 at the University of California at Berkeley, with the goal of providing an open system with sophisticated networking support. Has gone through several versions, including 4.1 BSD, 4.2 BSD, 4.3 BSD, etc. Provides a powerful text editor, called vi, a shell especially suited for C programming, called csh; Focused on file system performance and networking.

SunOs / Solaris, AIX, HP-UX, … SunOS / Solaris (Sun Microsystems) are originally a derivative of BSD UNIX 4.2 and 4.3 More recently based on System V The dominant UNIX OS in the workstation market. IBM’s AIX HP’s HP-UX … FreeBSD Linux

Android (based on Linux) A good website for beginners: http://www.ece.ncsu.edu/wireless/MadeInWALAN/AndroidTutorial/index.html

Mac OS x and iOS (Mach/BSD Linux)

Unix standards The system level differences in the Unix OS produced by various vendors is confusing  need a standardization. Standards are established because a consensus arises among vendors and customers about some products (for portability, interoperability, joint-development) Intended to ensure that any device / software can communicate with another device or software through conformance to an interface The standard defines this interface - but doesn't specify exactly how the device or software itself is written. Don't confuse the standard and the product!

Unix standards (cont’d) Three important standards in UNIX-related fields – ANSI C, POSIX, and Spec 1170 used in the textbook. ANSI C is an official standard for C by the ANSI and ISO. POSIX is a collection of official standards for OS interfaces by IEEE - also called IEEE Std. 1003 Spec 1170 is an emerging industrial standard for Unix by X/Open Foundation (later merged with The Open Group) American National Standards Institute (ANSI) International Standards Organization (ISO) International Standards Organization (ISO). POSIX stands for portable OS interface which specifies the interface between the OS and the user in a standard way so that application programs are portable across platforms. Spec 1170 is an emerging industrial standard for Unix by X/Open Foundation (initially formed by several European computer vendors and later becomes an international organization) more comprehensive and covering the entire application environment; incorporating several key standards such as POSIX 1003.1 and X Window system. used in the textbook for items such as networking services, which are not covered by a POSIX standard.

Links to Unix resources For UNIX history and standardization, see http://www.UNIX-systems.org/ For people and stories about UNIX and its descendants, see http://perso.wanadoo.fr/levenez/unix http://www.bell-labs.com/history/unix http://cm.bell-labs.com/cm/cs/who/dmr/cacm.html Do it for fun! - find out who owns the license of UNIX now