52
Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Embed Size (px)

Citation preview

Page 1: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science 5th Edition

Chapter 6

An Introduction to System Software and Virtual Machines

Page 2: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 2

Objectives

In this chapter, you will learn about:

• System software

• Assemblers and assembly language

• Operating systems

Page 3: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 33

Introduction

• Naked machine– Hardware bereft of any helpful user-oriented features– Data as well as instructions must be represented in

binary

• To make a Von Neumann computer usable:– Create an interface between the user and the

hardware

Page 4: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 44

System Software

• The virtual machine– System software: collection of computer programs

that manage the resources of a computer and facilitate access to those resources

– Software: sequences of instructions that solve a problem

Page 5: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 5

Figure 6.1 The Role of System Software

Page 6: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 6

Types of System Software

• Operating system– Communicates with users– Determines what they want– Activates other system programs, applications

packages, or user programs to carry out their request

Page 7: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 7

Types of System Software (continued)

• User interface– Provides user with an intuitive visual overview

• Language services (assemblers, compilers, and interpreters)– Allow you to write programs in a high level

• Memory managers– Allocate memory space for programs and data

• Information managers– Handle the organization, storage, and retrieval of

information on mass storage devices

Page 8: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 8

Figure 6.2 Types of System Software

Page 9: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 9

Types of System Software (continued)

• I/O systems– Allow you to easily and efficiently use the input and

output devices that exist on a computer system

• Scheduler– Keeps a list of programs ready to run on the

processor and selects the one that will execute next

• Utilities– Library routines that provide useful services either to

a user or to other system routines

Page 10: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 10

Assemblers and Assembly Language

• Problems with machine language– Uses binary– Is difficult to change– Is difficult to create data

Page 11: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 11

Assembly Language

• Assembly language – Low-level programming language– Each symbolic assembly language instruction is

translated into exactly one binary machine language instruction

• High-level programming languages– User oriented– Not machine specific– Use both natural language and mathematical

notation in their design

Page 12: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 12

Figure 6.3 The Continuum of Programming Languages

Page 13: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 13

Assembly Language(continued)

• Source program– Program written in assembly language

• Object program– Source program must be translated into a

corresponding machine language program

• Assembler– System software that carries out translation

• Advantage of assembly language– Allows use of symbolic addresses

Page 14: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 14

Figure 6.4 The Translation/ Loading/Execution Process

Page 15: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 15

Figure 6.5 Typical Assembly Language Instruction Set

Page 16: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 16

Assembly Language(continued)

• Advantages of symbolic labels – Program clarity– Maintainability

• Pseudo-op – Invokes the service of the assembler– Provides program construction

Page 17: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 17

Figure 6.6 Structure of a Typical Assembly Language Program

Page 18: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 18

Examples of Assembly Language Code

• Conditional operation– Tests and compares values

• Algorithmic problem-solving cycle – One of the central themes of computer science

Page 19: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 19

Figure 6.7 Algorithm to Compute the Sum of Numbers

Page 20: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 20

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

Page 21: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 21

Translation and Loading

• Assembler – Translates a symbolic assembly language program

into machine language– Tasks performed

• 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

Page 22: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 22

Translation and Loading (continued)

• Op code table– Alphabetized list of all legal assembly language op

codes and their binary equivalents

• In assembly language:– A symbol is defined when it appears in the label field

of an instruction or data pseudo-op

• Pass– Process of examining and processing every

assembly language instruction in the program, one instruction at a time

Page 23: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 23

Figure 6.9 Structure of the Op Code Table

Page 24: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 24

Figure 6.10 Generation of the Symbol Table

Page 25: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 25

Translation and Loading (continued)

• First pass over source code– Assembler looks at every instruction

• Binding– Process of associating a symbolic name with a

physical memory address

• Primary purposes of the first pass of an assembler – To bind all symbolic names to address values– To enter those bindings into the symbol table

Page 26: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 26

Translation and Loading (continued)

• Location counter– Variable used to determine the address of a given

instruction

• Second pass– Assembler translates source program into machine

language

• After completion of pass 1 and pass 2– Object file contains the translated machine

language object program

Page 27: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 27

Figure 6.11 Outline of Pass 1 of the Assembler

Page 28: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 28

Figure 6.12 Outline of Pass 2 of the Assembler

Page 29: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 29

Figure 6.13 Example of an Object Program

Page 30: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 30

Operating Systems

• Operating system– Waits for requests and activates other system

programs to service these requests

• System commands– Used to translate, load, and run programs

Page 31: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 31

Functions of an Operating System

• The user interface– Operating system commands usually request access

to hardware resources, software services, or information

– To communicate with a user, a GUI supports visual aids and point-and-click operations

Page 32: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 32

Figure 6.14 Some Typical Operating System Commands

Page 33: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 33

Figure 6.15 User Interface Responsibility of the Operating System

Page 34: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 34

Figure 6.16 Example of a Graphical User Interface

Page 35: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 35

System Security and Protection

• Operating system– Controls access to the computer and its resources– Safeguards password file– Sometimes uses encryption to provide security

• Access control – Use of a legal user name and password

Page 36: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 36

Figure 6.17 Authorization List for the File GRADES

Page 37: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 37

Efficient Allocation of Resources

• I/O controller – Frees the processor to do useful work while the I/O

operation is being completed

• To ensure that a processor does not sit idle if there is useful work to do:– Operating system keeps a queue of programs that

are ready to run

Page 38: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 38

The Safe Use of Resources

• Operating system – Prevents programs or users from attempting

operations that cause the computer system to enter a “frozen” state

• Deadlock– Each program is waiting for a resource to become

available that will never become free

Page 39: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 39

The Safe Use of Resources (continued)

• Deadlock prevention– Operating system uses resource allocation

algorithms that prevent deadlock from occurring in the first place

• Deadlock recovery algorithms– Detect and recover from deadlocks

Page 40: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 40

Summary of OS Responsibilities

• Major responsibilities of operating systems– User interface management (a receptionist)– Control of access to system and files (a security

guard)– Program scheduling and activation (a dispatcher)– Efficient resource allocation (an efficiency expert)– Deadlock detection and error detection (a traffic

officer)

Page 41: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 41

Historical Overview of OperatingSystems Development

• First-generation system software – Roughly 1945–1955– No operating systems and very little software

support

• Second-generation system software– Called batch operating systems (1955–1965)

• Command language– Commands specifying to the operating system what

operations to perform on programs

Page 42: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 42

Figure 6.18 Operation of a Batch Computer System

Page 43: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 43

Figure 6.19 Structure of a Typical Batch Job

Page 44: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 44

Historical Overview of OperatingSystems Development (continued)

• Third-generation operating systems – Multiprogrammed operating systems (1965–1985)– Many user programs are simultaneously loaded into

memory– User operation codes: could be included in any

user program– Privileged operation codes: use restricted to the

operating system or other system software

Page 45: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 45

Historical Overview of OperatingSystems Development (continued)

• Time-sharing system– Many programs can be stored in memory – Allows programmer to enter system commands,

programs, and data online

• Distributed environment – Much of the computing was done remotely in the

office, laboratory, classroom, and factory

• Network operating system– Fourth-generation operating system (1985–present)

Page 46: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 46

Figure 6.20 Configuration of a Time-Shared Computing System

Page 47: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 47

Figure 6.21 A Local Area Network

Page 48: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 48

Historical Overview of OperatingSystems Development (continued)

• Real-time operating system– Manages resources of embedded computers that

are controlling ongoing physical processes – Guarantees that it can service important requests

within a fixed amount of time

Page 49: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 49

The Future

• Multimedia user interfaces – Will interact with users and solicit requests in a

variety of ways

• Parallel processing operating system– Can efficiently manage computer systems containing

tens, hundreds, or even thousands of processors

• Distributed computing environment– Users do not need to know the location of a given

resource within the network

Page 50: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 50

Figure 6.23 Structure of a Distributed System

Page 51: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 51

Figure 6.24 Some of the Major Advances in Operating Systems Development

Page 52: Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s

Invitation to Computer Science, 5th Edition 52

Summary

• System software – Acts as an intermediary between the users and the

hardware

• Assembly language – Creates a more productive, user-oriented

environment than machine language

• An assembler – Translates an assembly language program into a

machine language program