Invitation to Computer Science 6th Edition

Slides:



Advertisements
Similar presentations
Lecture 1: Overview of Computers & Programming
Advertisements

Chapter 6: An Introduction to System Software and Virtual Machines Invitation to Computer Science, C++ Version, Third Edition.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Chapter 6: An Introduction to System Software and Virtual Machines Invitation to Computer Science, C++ Version, Third Edition.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Introduction to a Programming Environment
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 6: An Introduction to System Software and Virtual Machines
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.
Computer Software.
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
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
CS 1308 Computer Literacy and the Internet. Introduction  Von Neumann computer  “Naked machine”  Hardware without any helpful user-oriented features.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
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.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Computer Science/Ch. 5 System Softwares 5-1 Chapter 5 System Softwares.
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 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 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Chapter 4 Software. Introduction Program: is a set of sequence instructions that tell the computer what to do. Software: is a collection of programs,
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
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.
CT101: Computing Systems Introduction to Operating Systems.
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.
Chapter 1 Introduction 2nd Semester H
Invitation to Computer Science 6th Edition
OPERATING SYSTEM CONCEPT AND PRACTISE
Applied Operating System Concepts
Advanced Computer Systems
Applied Operating System Concepts
Chapter 1 Introduction.
Chapter 1 – Introduction to Computers, the Internet, and the Web
Chapter 3: Operating Systems
Operating System Interface between a user and the computer hardware
Topics Introduction Hardware and Software How Computers Store Data
Control Unit Lecture 6.
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Review of computer processing and the basic of Operating system
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1 Introduction.
Introduction to Operating System (OS)
Chapter 1: Introduction
Processor Management Damian Gordon.
Topics Introduction Hardware and Software How Computers Store Data
Operating System Concepts
Process Description and Control
Chapter 5: Computer Systems Organization
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1 Introduction(1.1)
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Computer Architecture
Chapter 2: Operating-System Structures
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Principles of Programming Languages
Chapter 1: Preliminaries
The Main Features of Operating Systems
Chapter 2: Operating-System Structures
Processor Management Damian Gordon.
Operating System Concepts
ICS103 Programming in C 1: Overview of Computers And Programming
Presentation transcript:

Invitation to Computer Science 6th Edition Chapter 6 An Introduction to System Software and Virtual Machines

Objectives In this chapter, you will learn about: System software Assemblers and assembly language Operating systems Invitation to Computer Science, 6th Edition

Introduction Von Neumann computer “Naked machine” Hardware without any helpful user-oriented features Data as well as instructions must be represented in binary Extremely difficult for a human to work with To make a Von Neumann computer usable: Create an interface between the user and the hardware Invitation to Computer Science, 6th Edition 3

Introduction (continued) Tasks of the interface Hide details of the underlying hardware from the user Present information in a way that does not require in-depth knowledge of the internal structure of the system Allow easy user access to the available resources Prevent accidental or intentional damage to hardware, programs, and data Invitation to Computer Science, 6th Edition

System Software System software The virtual machine a collection of compute programs that manage the resources of a computer and facilitate access to those resources Acts as an intermediary between users and hardware Creates a virtual environment for the user that hides the actual computer architecture Software: sequences of instructions that solve a problem The virtual machine Set of services and resources created by the system software and seen by the user Invitation to Computer Science, 6th Edition 5

Figure 6.1 The Role of System Software Invitation to Computer Science, 6th Edition

Types of System Software System software is a collection of many different programs Operating system Controls the overall operation of the computer Communicates with the user Determines what the user wants Activates system programs, applications packages, or user programs to carry out user requests Invitation to Computer Science, 6th Edition

Types of System Software (continued) Memory managers Allocate memory space for programs and data Information managers Handle the organization, storage, and retrieval of information on mass storage devices I/O systems Allow you to easily and efficiently use the input and output devices that exist on a computer system Invitation to Computer Science, 6th Edition

Types of System Software (continued) User interface Provides user with an intuitive visual overview Graphical user interface (GUI) provides graphical control of the capabilities and services of the computer Language services (assemblers, compilers, and interpreters) Allow you to write programs in a high-level, user-oriented language, and then execute them Invitation to Computer Science, 6th Edition

Types of System Software (continued) Scheduler Keeps a list of programs ready to run on the processor and selects the one that will execute next Utilities Collections of library routines that provide services either to user or other system routines Invitation to Computer Science, 6th Edition

Figure 6.2 Types of System Software Invitation to Computer Science, 6th Edition

Assemblers and Assembly Language Problems with machine language Uses binary Allows only numeric memory addresses Is difficult to change Is difficult to create data Invitation to Computer Science, 6th Edition

Assembly Language (continued) Assembly languages Designed to overcome shortcomings of machine languages Create a more productive, user-oriented environment Earlier termed second-generation languages Now viewed as low-level programming languages Invitation to Computer Science, 6th Edition

Assembly Language Assembly language High-level programming languages 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 Invitation to Computer Science, 6th Edition

Figure 6.3 The Continuum of Programming Languages Invitation to Computer Science, 6th Edition

Assembly Language (continued) Source program Program written in assembly language Object program A machine language program Assembler Translates a source program into a corresponding object program Invitation to Computer Science, 6th Edition

Figure 6.4 The Translation/ Loading/Execution Process Invitation to Computer Science, 6th Edition

Assembly Language (continued) Advantages of writing in assembly language rather than machine language Use of symbolic operation codes rather than numeric (binary) ones Use of symbolic memory addresses rather than numeric (binary) ones Pseudo-operations that provide useful user-oriented services such as data generation Invitation to Computer Science, 6th Edition

Typical Instruction of Assembly Language (Label): (op code mnemonic) (address field) (comments) Label: permanent identification for this instruction of data, like an address of command. op code mnemonic: symbolic command name Address field: symbolic address of the data Comments: for reading “--” Invitation to Computer Science, 6th Edition

Figure 6.5 Typical Assembly Language Instruction Set Invitation to Computer Science, 6th Edition

Invitation to Computer Science, 6th Edition

How to declare data in assembly language? Example: (pseudo-op) FIVE: .DATA 5 Address content 53 0000000000000101 NEGSEVEN: .DATA -7 54 1000000000000111 Invitation to Computer Science, 6th Edition

How to use data? LOAD FIVE ADD NEGSEVEN Invitation to Computer Science, 6th Edition

Assembly Language (continued) Advantages of symbolic labels Program clarity Maintainability Pseudo-op Invokes the service of the assembler Provides program construction .BEGIN .END Invitation to Computer Science, 6th Edition

Figure 6.6 Structure of a Typical Assembly Language Program Invitation to Computer Science, 6th Edition

Invitation to Computer Science, 6th Edition

Examples of Assembly Language Code Algorithmic operations Set the value of i to 1 (line 2). : Add 1 to the value of i (line 7). Invitation to Computer Science, 6th Edition

Examples of Assembly Language Code (continued) Assembly language translation 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 --The index value. Initially it is 0. ONE: .DATA 1 --The constant 1. Invitation to Computer Science, 6th Edition

Examples of Assembly Language Code (continued) Arithmetic expression A = B + C – 7 (Assume that B and C have already been assigned values) Invitation to Computer Science, 6th Edition

Examples of Assembly Language Code (continued) Assembly language translation LOAD B --Put the value B into register R. ADD C --R now holds the sum (B + C). SUBTRACT SEVEN --R now holds the expression (B + C - 7). STORE A --Store the result into A. : --These data should be placed after the HALT. A: .DATA 0 B: .DATA 0 C: .DATA 0 SEVEN: .DATA 7 --The constant 7. Invitation to Computer Science, 6th Edition

Examples of Assembly Language Code Conditional operation Tests and compares values Invitation to Computer Science, 6th Edition

Examples of Assembly Language Code Invitation to Computer Science, 6th Edition

Examples of Assembly Language Code (continued) Problem Read in a sequence of non-negative numbers, one number at a time, and compute a running sum When you encounter a negative number, print out the sum of the non-negative values and stop Invitation to Computer Science, 6th Edition

Figure 6.8 Assembly Language Program to Compute the Sum of Nonnegative Numbers Invitation to Computer Science, 6th Edition

Invitation to Computer Science, 6th Edition

Invitation to Computer Science, 6th Edition

Translation and Loading Before a source program can be run, an assembler and a loader must be invoked Assembler Translates a symbolic assembly language program into machine language Loader Reads instructions from the object file and stores them into memory for execution Invitation to Computer Science, 6th Edition

Translation and Loading (continued) Assembler: 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 Invitation to Computer Science, 6th Edition

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 (left) Pass Process of examining and processing every assembly language instruction in the program, one instruction at a time Invitation to Computer Science, 6th Edition

Translation and Loading (continued) Assemblers make two pass of the source code to generate object program. First pass: Handle memory address and bind physical address Second pass: Handle data generation and translate source program into object program Invitation to Computer Science, 6th Edition

Op Code Table Figure 6.9 Structure of the Op Code Table Invitation to Computer Science, 6th Edition

First Pass Figure 6.10 Generation of the Symbol Table Invitation to Computer Science, 6th Edition

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 Location counter Variable used to determine the address of a given instruction Invitation to Computer Science, 6th Edition

Figure 6.11 Outline of Pass 1 of the Assembler Invitation to Computer Science, 6th Edition

Translation and Loading (continued) Second pass Assembler translates source program into machine language Translate source program into object program. Eg: SUBSTRACT X Looks up SUBSTRACT in op code table Looks up the symbol X in the symbol table 0101 0000 0000 1001 Handle data generation Invitation to Computer Science, 6th Edition

Translation and Loading (continued) Second pass Translate source program into object program. Handle data generation Build proper binary representation (sign/magnitude or two's complement) Eg: LOAD NEGSEVEN … NEGSEVEN: .DATA -7 After completion of pass 1 and pass 2 Object file contains the translated machine language object program Invitation to Computer Science, 6th Edition

Figure 6.12 Outline of Pass 2 of the Assembler Invitation to Computer Science, 6th Edition

Figure 6.13 Example of an Object Program Invitation to Computer Science, 6th Edition

Invitation to Computer Science, 6th Edition

Invitation to Computer Science, 6th Edition

Operating Systems Operating system System commands Waits for requests and activates other system programs to service these requests System commands Used to translate, load, and run programs Types of system commands Lines of text typed at a terminal Menu items displayed on a screen and selected with a mouse and a button: Point-and-click Examined by the operating system Invitation to Computer Science, 6th Edition

Functions of an Operating System Five most important responsibilities of the operating system User interface management Control of access to system and files (security) Program scheduling and activation Efficient resource allocation Deadlock detection and error detection Invitation to Computer Science, 6th Edition

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, Text-oriented a GUI supports visual aids and point-and-click operations Invitation to Computer Science, 6th Edition

Figure 6.14 Some Typical Operating System Commands Invitation to Computer Science, 6th Edition

Responsibility of the Operating System Figure 6.15 User Interface Responsibility of the Operating System Invitation to Computer Science, 6th Edition

Figure 6.16 Example of a Graphical User Interface Invitation to Computer Science, 6th Edition

System Security and Protection Operating system Non-authorized people from using the computer User names and passwords Legitimate users from accessing data or programs they are not authorized to access Authorization lists Safeguards password file Sometimes uses encryption to provide security Access control Use of a legal user name and password Invitation to Computer Science, 6th Edition

Figure 6.17 Authorization List for the File GRADES Invitation to Computer Science, 6th Edition

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 Invitation to Computer Science, 6th Edition

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 Program A Program B Get Data from D Get the laser printer Get the laser printer Get the data file D Print the file Print the file Invitation to Computer Science, 6th Edition

The Safe Use of Resources (continued) Deadlock prevention Operating system 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 resource it currently owns and issue a completely new request. Deadlock recovery algorithms Detect and recover from deadlocks Invitation to Computer Science, 6th Edition

Historical Overview of Operating Systems 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 Invitation to Computer Science, 6th Edition

Figure 6.18 Operation of a Batch Computer System Invitation to Computer Science, 6th Edition

Figure 6.19 Structure of a Typical Batch Job Invitation to Computer Science, 6th Edition

Historical Overview of Operating Systems Development (continued) Third-generation operating systems Multiprogrammed operating systems (1965–1985) Many user programs are simultaneously loaded into memory Invitation to Computer Science, 6th Edition

Historical Overview of Operating Systems 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) Invitation to Computer Science, 6th Edition

Figure 6.20 Configuration of a Time-Shared Computing System Invitation to Computer Science, 6th Edition

Figure 6.21 A Local Area Network Invitation to Computer Science, 6th Edition

Historical Overview of Operating Systems 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 Invitation to Computer Science, 6th Edition

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 Invitation to Computer Science, 6th Edition

Figure 6.23 Structure of a Distributed System Invitation to Computer Science, 6th Edition

Figure 6.24 Some of the Major Advances in Operating Systems Development Invitation to Computer Science, 6th Edition

Summary System software Assembly language An assembler 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 Invitation to Computer Science, 6th Edition

Java preparation Java download: Eclipse: Free Video Tutorials http://www.java.com/en/download/manual.jsp Eclipse: http://www.eclipse.org/downloads/ Free Video Tutorials http://eclipsetutorial.sourceforge.net/totalbeginner.html Invitation to Computer Science, 6th Edition