Chapter 6 An Introduction to System Software and Virtual Machines 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu Chang ) 博士 Office: ES 709 TEL: 05-5342601 ext. 4337 E-mail:

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
CS 345 Computer System Overview
Lecture 1: History of Operating System
Chapter 6: An Introduction to System Software and Virtual Machines Invitation to Computer Science, C++ Version, Third Edition.
Chapter 6: An Introduction to System Software and Virtual Machines Invitation to Computer Science, C++ Version, Third Edition.
Understanding Operating Systems 1 Overview Introduction Operating System Components Machine Hardware Types of Operating Systems Brief History of Operating.
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
A. Frank - P. Weisberg Operating Systems Evolution of Operating Systems.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Topic 1: Introduction to Computers and Programming
Chapter 6: An Introduction to System Software and Virtual Machines
1 The development of modern computer systems Early electronic computers Mainframes Time sharing Microcomputers Networked computing.
Computer Science 101 The Virtual Machine: Operating Systems.
Chapter 6: An Introduction to System Software and Virtual Machines Invitation to Computer Science, C++ Version, Fourth Edition ** Re-ordered, Updated 4/14/09.
Systems Software Operating Systems.
Computer Software.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Computer Organization
System Calls 1.
Slide 1 System Software Software The term that we use for all the programs and data that we use with a computer system. Two types of software: Program.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
Topics Introduction Hardware and Software How Computers Store Data
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
CS 1308 Computer Literacy and the Internet. Introduction  Von Neumann computer  “Naked machine”  Hardware without any helpful user-oriented features.
CISC105 General Computer Science Class 1 – 6/5/2006.
CHAPTER FOUR COMPUTER SOFTWARE.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s.
Computer Science 101 How the Assembler Works. Assembly Language Programming.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Lead Black Slide. © 2001 Business & Information Systems 2/e2 Chapter 5 Information System Software.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Computer Science/Ch. 5 System Softwares 5-1 Chapter 5 System Softwares.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
C o n f i d e n t i a l 1 Course: BCA Semester: III Subject Code : BC 0042 Subject Name: Operating Systems Unit number : 1 Unit Title: Overview of Operating.
Chapter 6 An Introduction to System Software and Virtual Machines.
Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.
Operating System Principles And Multitasking
1 Software. 2 What is software ► Software is the term that we use for all the programs and data on a computer system. ► Two types of software ► Program.
CPSC 171 Introduction to Computer Science System Software and Virtual Machines.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
CSC190 Introduction to Computing Operating Systems and Utility Programs.
Copyright © Curt Hill Operating Systems An Introductory Overview.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
1.1 Sandeep TayalCSE Department MAIT 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming Batched Systems Time-Sharing Systems.
Chapter 4 Software. Introduction Program: is a set of sequence instructions that tell the computer what to do. Software: is a collection of programs,
Systems and User Interface Software. Types of Operating System  Single User  Multi User  Multi-tasking  Batch Processing  Interactive  Real Time.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 0: Historical Overview.
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.
Invitation to Computer Science 6th Edition
2. OPERATING SYSTEM 2.1 Operating System Function
Operating System Interface between a user and the computer hardware
Topics Introduction Hardware and Software How Computers Store Data
Chapter 2: System Structures
Review of computer processing and the basic of Operating system
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Introduction to Operating System (OS)
Invitation to Computer Science 6th Edition
Computers: Hardware and Software
Topics Introduction Hardware and Software How Computers Store Data
Chapter 1 Introduction(1.1)
The Main Features of Operating Systems
ICS103 Programming in C 1: Overview of Computers And Programming
Presentation transcript:

Chapter 6 An Introduction to System Software and Virtual Machines 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu Chang ) 博士 Office: ES 709 TEL: ext

2 Introduction The computer model, known as Von Neumann machine described previously is capable of executing programs written in machine language. However, it lacks “ support tools ” to make the problem- solving task easy. A naked machine: hardware loss of any helpful user-oriented features.

3 Naked Machines Need to write the program in 0s and 1s. Need to represented data in binary form. Need to manually store programs into memory before executing. Need to instruct the program to start running …

4 User Interface To make a Von Neumann computer usable, we must create a user interface between user and hardware.  Hide from the user the messy and unnecessary details of the underlying hardware  Present information about what is happening in a way that does not require in-depth knowledge of the internal structure of the system  Allow easy user access to the resource available on this machine  Prevent accidental or intentional damage to hardware, programs, and data

5 System Software System Software:  A collection of computer programs that manage the resources of a computer and facilitate access to those resources.  System software acts as an intermediary between the users and the hardware.  The set of services and resources created by the software and seen by the user is called a virtual machine or virtual environment.

6 System Software (cont.) The responsibilities of system software  Hide from the user details of the internal structure of the Von Neumann architecture.  Present important information in a way that is easy to understand.  Allow the user to access hardware resources in a simple and efficient way.  Provide a secure and safe environment in which to operate.

7 Types of System Software Operating system, might contain:  Language translators: assemblers, compilers.  Memory managers Allocate memory space for programs and data and load programs into memory prior to execution.  File system Handle the storage and retrieval of information on mass storage devices.  Scheduler Keeps a list of programs ready to run on the processor and selects that will execute next.  Utilities Collections of library routines that provide useful services either to a user or to other system routines.

8 Type of System Software

9 Writing a program Use a text editor to create a program P written in high-level language. Use the file system to store program P on the hard disk. Use a language translator to translate program P from a high-level language into a machine language program M.

10 Writing a program(cont ’ d) Use a loader to allocate sufficient memory to hold program M and load its instructions into memory. Use the scheduler to schedule and run M. Use a file system to store the output of program M into data file D. If the program did not complete successfully, use a debugger to help locate the error.

11 Machine Language Designed from a machine’s point of view, complicated and difficult to understand:  It uses binary: no English-like words, mathematical symbols.  It allows only numeric memory addresses.  It is difficult to change.  It is difficult to create data.

12 Assembly Language Designed for people as well as computers Created a more productive, user-oriented environment One of the most important new developments in programming Second-generation language More properly viewed as Low-level programming languages

13 Assembly Language (cont’d) Contrast with languages like BASIC, C, C++, Java, which are high-level programming languages. Source program  The programs written by users. Object program  A type of machine language.

14 The Continuum of Programming Languages

15 Language Translators The software translate source program (assembly) to object program (machine code) is called assembler. Translators for high-level programming language are called compilers.

16 The translation/Loading/Execution Process

17 Advantages of Assembly Language Use of symbolic operation codes rather than numeric ones. Use of symbolic memory addresses rather than numeric ones. Data generation, the programmer can ask the assembler to do data conversion. Pseudo-operations that provide useful user- oriented services such as data generation.

18 Assembly Language Format Format: label: op code mnemonic address field -- comment Comment is ignored during translation and execution. Op code mnemonic specifies the type of operation (Fig. 6.5) Symbolic labels have two advantages over numeric addresses  Program clarity  Maintainability

19 Typical Assembly Language Instruction Set

20 Data Generation using pseudo-op A pseudo-op invokes a service of the assembler. Can be used to generate data:. DATA +5 Can be used for program construction:. BEGIN. END  They do not generate any instructions or data. 將 +5 轉成二進位表示,並 且儲存在 memory 中。

21 Structure of a Typical Assembly Language Program

22 Example of Assembly (Fig. 2.9 sequential search algorithm) LOAD ONE -- put a 1 into register R STORE I -- store the constant 1 into i : : INCREMENT I --add 1 to memory location i : : I :.DATA 0 ONE:.DATA 1

23 More Examples Arithmetic expression A=B+C-7 (see p.249) Conditional operation (see p.249) Looping (see p ) Compute sum of Non-Negative numbers (see p.253)

24 More Examples (Cont.) Arithmetic expression A=B+C-7  LOADB ADDC SUBTRACTSEVEN STOREA … A:.DATA0 B:.DATA0 C:.DATA0 SEVEN:.DATA7

25 More Examples (Cont.) Conditional operation Input the value of x Input the value of y If x>= y then output the value of x Else Output the value of y INX INY LOADY COMPARE X JUMPLT PRINTY OUTX JUMPDONE PRINTY:OUTY DONE: … X:.DATA0 Y:.DATA0

26 Figure 6.7 Algorithm to Compute the Sum of Numbers

27 Figure 6.8 Assembly Language Program to Compute the Sum of Nonnegative Numbers

28 Translation and Loading The job of an assembler is to translate a symbolic assembly language program into machine language. (object file ) The task of a loader is to read instructions from the object file and store them into memory for execution.

29 Assembler An Assembler must perform the following four tasks  Convert symbolic op codes to binary  Convert symbolic addresses to binary  Perform the assembler services requested by the pseudo-ops  Put the translated instructions into a file for future use.

30 Op Code Table The conversion of symbolic op codes such as LOAD, ADD, and SUBTRACT to binary makes use of a structure called the op code table. This is an alphabetized list of all legal assembly language op codes and their binary equivalents. Use binary search to find correspondence. Operation Binary Value Structure of the OP code Table

31 Symbolic Addresses Conversion After the Op code has been converted into binary, the assembler must perform a similar task on the address field. Translation is a two-pass process:  First pass: Build the symbol table in the first pass (Fig. 6.10, 6.11) Looks at every instruction Keeping track of the memory address Determines the address of the label.  Second pass: translate the source program into machine language. (plus handle data generation, produce object file … ). (Fig )

32 Generation of the Symbol Table 假設每個指令和資料均佔 1 byte ,且位址由 0 開始。 前向參考 (forward reference) DATA 放在 HALT 之後

33 Translation and loading (cont.) Binding  The process of associating a symbolic name with a physical memory address is called binding. Two primary purpose of the 1st pass  To bind all symbolic names to address values  To enter those bindings into the symbol table. Location counter  It is using to determine the address where each instruction will ultimately be stored.  The variable used to determine the address of a given instruction or piece of data is called location counter.

34 Outline of Pass 1 of the Assembler

35 Translation and loading (cont.) The responsibilities of pass 2 of the assembler  Translates the source program into machine language. Look up the op code table to translate mnemonic op codes to binary. Look up the symbol table to translate symbolic addresses to binary.  Handle data generation pseudo-ops  Produce the object file

36 Fig 6.12 Outline of Pass 2 of the Assembler

37 Fig Example of an Object Program

38 The Loader  The object program would become input to loader.  The loader read instructions from the object file and store them into memory for execution.  When loading is complete, the loader places the address of the first instruction into the program counter (PC) to initial execution.

39 Operating Systems What program examines commands?  System command: may be lines of text typed at a terminal.  Point-and-click: menu items displayed on a screen and selected with a mouse and a button. What piece of system software waits for requests and activates other system program? The answer is the operating system. Functions of an OS  The user interface  System security and protection  Encryption  Efficient allocation resource  The safe use of resource

40 The User Interface The operating system acts like the computer’s receptionist and dispatcher The OS commands usually request access to hardware resources, software service, or information. After a command is entered, OS is analyzed to see which software package needs to be loaded and put on the scheduler for execution. (see Fig. 6.15)

41 Some Typical Operating System Commands  Translate a program  Load a translated program into memory  Link together separate pieces of software to build a single program.  Run a program  Save information in a file  Retrieve a file previously stored  List all the files for this user  Print a file  Copy a file from one I/O device to another  Establish a network connection  Tell me the current time and date

42 Figure 6.15 User Interface Responsibility of the Operating System

43 The User Interface (cont.) Types of the User Interface  Prompt character Command language  Graphical user interface, GUI The GUI supports visual aids and point-and-click operations requiring a mouse, rather than textual commands. The interface uses icons, pull-down menus, scrolling windows…

44 Example of a GUI

45 System security and protection OS has the responsibilities of a security guard— controlling access to the computer and its resource. OS must prevent unauthorized users from accessing the system and prevent authorized users from doing unauthorized things. In most OS, access control is handled by requiring a user to enter a legal user name and password before any other requests are accepted. The password file is maintained by superuser.  Encrypt the password file using an encoding algorithm.  Encrypted text

46 System security and protection (cont.) OS must check to see who is the owner of the file The different levels of operations that various users may be permitted to do on a file.  Read only  Append new information to the end of the file but not change existing information.  Changes existing information in the file  Delete the entire file from the system Ex: File Grades NamePermitted Operations SmithR(R=Read only) JonesRA(A=Append) AdamsRAC(C=Change) DoeRACD(D=Delete)

47 Efficient Allocation of Resources To see that the resources of a computer system are used efficiently and well Three classes of programs  Running The program currently executing on the processor  Ready Programs that are loaded in memory and ready to run but are not yet executing.  Waiting Programs that cannot run because they are waiting for an I/O

48 The Safe Use of Resource Not only must resource be used efficiently, they must also be used safely.  It is the job of the OS to prevent programs or users from attempting operations that could cause the computer system to enter a state where it is incapable of doing any further work.  Program AProgram B Get the tape driveGet the laser printer Get the laser printerGet the tape drive Print the filePrint the file

49 The Safe Use of Resource (cont.) Deadlock  Each program will be waiting for a resource to become available that never will be free.  There is a set of programs each of which is waiting for an event to occur before it may proceed, but that event can be caused only by another waiting program in the set. Deadlock prevention  The OS uses resource allocation algorithms that prevent deadlock from occurring in the first place.  If a program cannot get all the resources that it needs, it must give up all the resources it currently owns and issue a completely new request. Deadlock recovery  We are powerless to guarantee that deadlock conditions can never occur.  We must detect them and recover from them when they do occur.

50 Summary The major responsibilities of the OS  User interface management  Program scheduling and activation  Control of access to system and files  Efficient resource allocation  Deadlock detection, error detection

51 Historical Overview of OS development First generation OS ( )  No OS, there was very little software support (just the assembler and loader)  All machine operation was “hands-on” Second generation OS ( )  Batch operating system  Computer operator groups the programs into a “batch”  After a few programs were collected, the operator would carry this batch of cards to a small I/O computer that would put these programs on tape.  These tapes would be carried into the machine room and loaded onto the “big” computer  Writing the results to another tape.

52 Fig Operation of a Batch Computer System

53 Fig Structure of a Typical Batch Job Because programmers no longer operated the machine, they need a way to communicate to the OS what had to be done. Job control language

54 Historical Overview of OS development (cont.)  Command language Job control language Users wrote commands specifying to the OS what operations to perform on their programs  The batch OS kept only a single program in memory at any one time. Third generation OS( )  Multiprogramming Operating Systems  There are many user programs simultaneously loaded into memory.  If the currently executing program pauses for I/O, one of the other ready jobs is selected for execution.  Protecting user programs

55 Historical Overview of OS development (cont.) Operating system Program 1 Program 2 Program 3 Program K A (upper bound) B (lower bound) Multiprogramming Memory Protected The 3G OS would keep track of the upper and lower address bounds of each program in memory.

56 Historical Overview of OS development (cont.)  User operation codes That could be included in any user program.  Privileged operation codes Whose use was restricted to the operating system or other system software Eg. HALT instruction  Time-sharing system ( ) Central Computer T T T T T T Telecommunications link Terminal

57 Historical Overview of OS development (cont.)  compute-bound It does mostly computation and little or no I/O A compute-bound job keeps the processor heavily utilized. To design a time-sharing system, we must make some change to the multiprogramming OS  A program can keep the processor until either of the following events occurs: It initiates an I/O operation. It has run for a maximum length of time, called a time slice.  The basic idea in a time-sharing system is to service many users in a circular round-robin fashion. Given each user a small amount of time and then moving on to the next.

58 Historical Overview of OS development (cont.)  The number of simultaneous users that can be serviced by a time-sharing system depends on: The speed of the processor The time slice given to each user The type of operation each user is doing  Single-user OS Gave one user total access to the entire system.  Distributed environment Much of the computing was done remotely in the office. Computing moved out of the computer center to where the work was being done

59 Historical Overview of OS development (cont.) The fourth-generation OS (1985-present)  Supported both local computation and remote access to other users and shared resources.  Network operating system The OS Manages not only the resources of a single computer but also the capabilities of a telecommunications system called a local area network (LAN). LAN is a network that is located in a geographically contiguous area such a room, a building, or a campus. LAN is composed of PCs, workstations, servers, all interconnected via a high-speed bus.

60 Historical Overview of OS development (cont.) There are many shared resources that can be provided by a network and its OS:  File servers It is a large disk storage facility that is available to any user on the network.  Printer servers  Compute server  Mail server

61 A Local Area Network (LAN)

62 Figure 6.22 The Virtual Environment Created by a Network Operating System

63 Historical Overview of OS development (cont.) Real time operating system  It guarantees that it can service the important requests within a fixed amount of time.  All requests to a real-time OS are prioritized. Embedded system  To place computer inside other pieces of equipment to control their operation.  Eg. Include computers placed inside automobile engines, microwave ovens…

64 Historical Overview of OS development (cont.) Fifth Generation OS  Multimedia user interface  Parallel processing OS That will manage systems containing hundreds or even thousands of processors.  Distributed operating system The user does not care where or how the system satisfies a request as long as it gets done correctly.

65 Historical Overview of OS development (cont.) In a 4G OS, the user issues the following types of commands  Access file F on file server S and copy it to my local system  Run program P on machine M  Save file F on file server T  Print file F on printer server Q

66 Historical Overview of OS development (cont.) In a distributed OS, the user issues the following types of commands  Access file F wherever it may be  Run program P on any machine currently available  Save file F wherever there is sufficient room.  Print file F on any printer with 400 dpi resolution that is not in use right now.

67 Figure 6.23 Structure of a Distributed System