Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The Operating System Allocates memory for.

Slides:



Advertisements
Similar presentations
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Advertisements

Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX – The Process The Process A process is.
Chapter One The Essence of UNIX.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
CS 497C – Introduction to UNIX Lecture 3: Inside UNIX Chin-Chih Chang
1 Operating Systems Ch An Overview. Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Bare Bones Computer.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
UNIX chapter 03 Getting Started Mr. Mohammad Smirat.
An Introduction to Operating Systems. Definition  An Operating System, or OS, is low-level software that enables a user and higher-level application.
Unix Presentation. What is an Operating System An operating system (OS) is a program that allows you to interact with the computer -- all of the software.
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.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Operating System. Architecture of Computer System Hardware Operating System (OS) Programming Language (e.g. PASCAL) Application Programs (e.g. WORD, EXCEL)
 What is OS? What is OS?  What OS does? What OS does?  Structure of Operating System: Structure of Operating System:  Evolution of OS Evolution of.
Operating Systems.
 Introduction to Operating System Introduction to Operating System  Types Of An Operating System Types Of An Operating System  Single User Single User.
COSC513 Project Linux Features Instructor: Prof. Mort Anvari Student: Yingfeng Luo ID: #
Standard Grade Computing System Software & Operating Systems.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX – The Shell The Shell The agency that.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
CENT 305 Information Systems Security Linux Introduction.
Operating System - Linux Ph. D. Course Work : PHYS 601 Statistics and Computer Applications Presented By: Sanjay Godara Dept. of Physics & Astrophysics.
UNIX and Shell Programming (06CS36) Unit 1 Continued… Shrinivas R. Mangalwede Department of Computer Science and Engineering K.L.S. Gogte Institute of.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
CS 390 Unix Programming Environment Summer Suchindra Rengan - CS3902 Course Details Instructors Suchindra Rengan – ‘sachin’ ( Section 001)
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Systems Software Operating Systems. What is software? Software is the term that we use for all the programs and data that we use with a computer system.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
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.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
UNIX and Shell Programming
February 02Page 1 Operating Systems Introduction.
Introduction to Programming Using C An Introduction to Operating Systems.
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
UNIX Unit 1- Architecture of Unix - By Pratima.
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.
Chapter 9: Networking with Unix and Linux. Objectives: Describe the origins and history of the UNIX operating system Identify similarities and differences.
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.
Operating Systems.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
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.
An operating system (OS) is a collection of system programs that together control the operation of a computer system.
Learning Unix/Linux Based on slides from: Eric Bishop.
Operating System Structure Lecture: - Operating System Concepts Lecturer: - Pooja Sharma Computer Science Department, Punjabi University, Patiala.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Overview of Linux Fall 2016 Dr. Donghyun Kim
Introduction to comp. and prog. CS 101 G 964
Welcome to Linux Chap#1 Hanin Abdulrahman.
Unix : Introduction and Commands
Outline Chapter 2 (cont) OS Design OS structure
Welcome to Linux Chap#1 Hanin Abdulrahman.
System calls….. C-program->POSIX call
Welcome to Linux Chap#1.
Operating System By Prakash G Asnani
Lecture 6 Introduction to Process Management
Presentation transcript:

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The Operating System Allocates memory for the program and loads the program in it. It also loads the CPU registers with control information. The registers maintain the memory locations where each segment of a program is stored. The instructions provided in the program are executed by the CPU. The OS keeps track of the instruction that was last executed. This enables it to resume a program if it had to be taken out of the CPU before it completed execution.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The Operating System If program needs to access hardware, it makes a call to the OS; for example for file I/O, the OS directs the disk controller to open the file and make the disk available to the program. After the program has completed execution, the operating system cleans up the memory and registers and makes them available for the next program. Modern OS are multiprogramming; however, computers with single CPU, only one program can run at one time.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The Operating System The OS generally allows a program to run for an instant, saves its state, and then loads next program in the queue. The OS creates a process for each program and controls switching of these processes. Programs often access disk I/O, these operations keep the CPU idle; so the OS takes the program out of CPU while the I/O operation is in progress and schedules another program to run. It provides maximum utilization of the CPU.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Operating System Many (proprietary) operating systems in the past, one from each hardware vendor written in a near-machine language known as assembler.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Operating System Written in C not assembler. C is high level with portability considerations in mind. For programmers, UNIX offers a rich set of programming tools to aid in developing, debugging, and maintaining programs. One of these program is the system command’s interpreter, called the shell Interaction with UNIX system through the shell.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Operating System A command may already exist on the system or written by you. Power of UNIX lies in combining these commands similar to the English language. UNIX was written by programmers for their own use, so things may not always appear obvious to you.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. Knowing your Machine UNIX can used by many users concurrently A terminal emulation facility running on a PC or workstation allows the PC to behave like a dumb terminal. Functions of many of keys change when the same PC doubles as UNIX box.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The System administrator On a large system serving hundreds of users, someone has to be in-charge of administering the system. Responsible for the management of the entire setup, allocating user accounts, maintain file systems, taking backups, managing disk space, and perform several other important functions. If you run some flavor of UNIX on your machine, then you are probably its administrator.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. Logging In and Out The good old dumb terminal connected to the serial port was the way to connect to UNIX. Later Terminal programs became popular. For security reasons, SSH could be the only means of connecting to the remote UNIX box. UNIX users may use Putty or any of the free SSH programs available on the Net.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. A Hands-On Session UNIX is case sensitive; and commands are generally in lowercase; unlike DOS both date and DATE will work $DATE (ksh: DATE: not found) Every UNIX system maintains an internal clock; you can access it with a single command named date: $date (Mon Jan 14 19:31:56 GMT 2008) View the list of current users with the who command $ who

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. A Hands-On Session Viewing Process with ps $ ps The last columns in the ps command shows the process named bash (Bash shell); other possible shells are ksh (Korn shell), sh (primitive Bourne shell), csh (C shell) $ echo $SHELL (/usr/bin/ksh) Handling Files – several ways to create a file echo date > foo Display file with cat cat foo

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. A Hands-On Session Copying a file with cp - $ cp foo foo.sh Display list of files with command $ ls Rename a file with $ mv Removing the file with $ rm Handling directories Create a directory with $ mkdir try $ ls -F Directory navigation pwd cd Remove directory $ rmdir try $ sh foo? What happens

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. POSIX and the single UNIX specification Dennis Ritchie’s decision to write UNIX in C – not portable; also the absence of a single conforming standard adversely affected the development of portable applications. AT&T created the “System V interface Definition” (SVID) Later the X/Open (now the Open group), a consortium of vendors and users created X/Open Portability Guide (XPG) The Portable Operating System Interface for Computer Environment (POSIX) was developed – refers to OS in general, but was based on UNIX

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. Linux and GNU Linux – the free UNIX Free Software Foundation (formerly known as GNU – the recursive acronym that stands for “GNU’s Not Unix!”).

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Architecture Division of Labor - two agencies kernel shell

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Architecture The kernel interacts with the machine’s ________ it is the core of the _______ gets loaded into memory at _______ ________ comprises of set of routines (written in C) to communicate with the _________ directly. User’s applications communicate with the kernel via _____ _____ in order to access the _______ manages system memory schedule processes decides priorities for the ________ and performs other miscellaneous tasks

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Architecture The shell the outer part of the ________ ________ an interpreter responsible for ________ user commands into action an interface between the user and the _______ one kernel – several shells (for each user who is logged in) examines the keyboard input (command) for special characters prior to communicating with the ________

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Architecture The File and Process Files have ________ Processes have _______ Files Files are containers Files are static Directories and devices are also files Files are related to other files by being a part of single hierarchical structure called _____ ______

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Architecture Process A program in execution Dynamic – resembles living organisms (born and die) also forms hierarchy – when a process is a child of another process UNIX provides tools to control processes move them between foreground and background or kill them

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Architecture The System Calls UNIX System kernel, shell, applications – written in C kernel offers services such as disk I/O operations programs access these kernel services by invoking special functions called ______ ______ C programmers can not use “write” system call on Windows system; instead Windows system use the standard library functions for everything; for example fprintf In UNIX, users have access to both write and fprintf in a C program meant to run a UNIX machine write – a system call fprintf – library function

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The UNIX Architecture POSIX ____ _____ ____ ____ for ______ ______ specifies the system calls that all UNIX systems must implement

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. Features of UNIX A multiuser system UNIX is a multiprogramming system it permits multiple programs to remain in memory and compete for CPU These programs can be run by different users – multiuser Windows - single user system CPU, memory and hard disk; all dedicated to a single user kernel uses the principle of time sharing A multitasking system UNIX is a multitasking system user can edit a file, print another one, send to a friend, and browse WWW – without leaving any of the applications

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. Features of UNIX users can see one job running in the foreground; the rest run in the background you can switch jobs between foreground and background, suspend or terminate as a programmer, edit the C program with the vi editor and then suspend the vi process to run the cc compiler; there is no need to quit vi Repository of Applications kernel can not do everything for the users host of applications shipped with UNIX system new tools are being added

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. Features of UNIX The Building block A complex task can be broken into finite number of simple ones shell offers a mechanism called the pipe that allows the output of one command to server as input to another that is why who output does not include a header; in case you needed to count the number of users by supplying the output to a word counting program

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. Features of UNIX Pattern Matching UNIX features many sophisticated pattern matching features For example, all C programs have the.c extension, and to use the tar command, we can just use a pattern *.c to back them to tape * - referred to as a metacharacter printf.*name – a regular expression to match all lines containing both printf and name

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. Features of UNIX Programming Facility The UNIX shell is also a programming language it has control structures and variables These features are used to design shell scripts programs that run UNIX commands in a batch Documentation UNIX documentation is no longer a sore point The online help facility – man commands A vast ocean of UNIX resources is available on the Internet