Objectives
Chapter 6: An Introduction In this chapter, you will learn about: to System Software and System software Virtual Machines
Invitation to Computer Science, Assemblers and assembly language C++ Version, Third Edition
Operating systems
Invitation to Computer Science, C++ Version, Third Edition 2
Introduction Introduction (continued)
Von Neumann computer Tasks of the interface
“Naked machine”
Hide details of the underlying hardware from the Hardware without any helpful user-oriented features user
Extremely difficult for a human to work with Present information in a way that does not require An interface between the user and the hardware in-depth knowledge of the internal structure of the is needed to make a Von Neumann computer system usable
Invitation to Computer Science, C++ Version, Third Edition 3 Invitation to Computer Science, C++ Version, Third Edition 4
Introduction (continued) System Software: The Virtual Machine
Tasks of the interface (continued) System software
Acts as an intermediary between users and hardware Allow easy user access to the available resources
Creates a virtual environment for the user that hides the actual computer architecture Prevent accidental or intentional damage to hardware, programs, and data Virtual machine (or virtual environment)
Set of services and resources created by the system software and seen by the user
Invitation to Computer Science, C++ Version, Third Edition 5 Invitation to Computer Science, C++ Version, Third Edition 6
1 Types of System Software
System software is a collection of many different programs
Controls the overall operation of the computer
Communicates with the user
Determines what the user wants
Activates system programs, applications Figure 6.1 packages, or user programs to carry out user The Role of System Software requests
Invitation to Computer Science, C++ Version, Third Edition 7 Invitation to Computer Science, C++ Version, Third Edition 8
Types of System Software (continued)
User interface
Graphical user interface (GUI) provides graphical control of the capabilities and services of the computer
Language services
Assemblers, compilers, and interpreters
Figure 6.2 Allow you to write programs in a high-level, user- Types of System Software oriented language, and then execute them
Invitation to Computer Science, C++ Version, Third Edition 9 Invitation to Computer Science, C++ Version, Third Edition 10
Types of System Software (continued) Types of System Software (continued)
Memory managers Scheduler
Allocate and retrieve memory space Keeps a list of programs ready to run and selects Information managers the one that will execute next
Handle the organization, storage, and retrieval of information on mass storage devices Utilities I/O systems Collections of library routines that provide services Allow the use of different types of input and output devices either to user or other system routines
Invitation to Computer Science, C++ Version, Third Edition 11 Invitation to Computer Science, C++ Version, Third Edition 12
2 Assemblers and Assembly Language: Assembly Language (continued) Assembly Language Assembly languages Machine language Designed to overcome shortcomings of machine Uses binary languages
Allows only numeric memory addresses Create a more productive, user-oriented environment Difficult to change Earlier termed second-generation languages Difficult to create data Now viewed as low-level programming languages
Invitation to Computer Science, C++ Version, Third Edition 13 Invitation to Computer Science, C++ Version, Third Edition 14
Assembly Language (continued)
Source program
An assembly language program
Object program
A machine language program
Assembler
Figure 6.3 Translates a source program into a corresponding The Continuum of Programming Languages object program
Invitation to Computer Science, C++ Version, Third Edition 15 Invitation to Computer Science, C++ Version, Third Edition 16
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
Figure 6.4 Pseudo-operations that provide useful user- The Translation/Loading/Execution Process oriented services such as data generation
Invitation to Computer Science, C++ Version, Third Edition 17 Invitation to Computer Science, C++ Version, Third Edition 18
3 Examples of Assembly Language Code (continued)
Algorithmic operations
Set the value of i to 1 (line 2).
:
Add 1 to the value of i (line 7).
Figure 6.6 Structure of a Typical Assembly Language Program
Invitation to Computer Science, C++ Version, Third Edition 19 Invitation to Computer Science, C++ Version, Third Edition 20
Examples of Assembly Language Examples of Assembly Language Code (continued) Code (continued)
Assembly language translation Arithmetic expression
LOAD ONE --Put a 1 into register R. A = B + C – 7 STORE I --Store the constant 1 into i. : (Assume that B and C have already been assigned INCREMENT I --Add 1 to memory location i. values) : I: .DATA 0 --The index value. Initially it is 0. ONE: .DATA 1 --The constant 1.
Invitation to Computer Science, C++ Version, Third Edition 21 Invitation to Computer Science, C++ Version, Third Edition 22
Examples of Assembly Language Examples of Assembly Language Code (continued) Code (continued)
Assembly language translation Problem LOAD B --Put the value B into register R. ADD C --R now holds the sum (B + C). Read in a sequence of non-negative numbers, SUBTRACT SEVEN --R now holds the expression (B + C - 7). one number at a time, and compute a running STORE A --Store the result into A. : --These data should be placed after the sum HALT. A: .DATA 0 When you encounter a negative number, print out B: .DATA 0 the sum of the non-negative values and stop C: .DATA 0 SEVEN: .DATA 7 --The constant 7.
Invitation to Computer Science, C++ Version, Third Edition 23 Invitation to Computer Science, C++ Version, Third Edition 24
4 Figure 6.7 Figure 6.8 Assembly Language Program to Algorithm to Compute the Sum of Numbers Compute the Sum of Nonnegative Numbers
Invitation to Computer Science, C++ Version, Third Edition 25 Invitation to Computer Science, C++ Version, Third Edition 26
Translation and Loading Translation and Loading (continued)
Before a source program can be run, an Assembler tasks assembler and a loader must be invoked Convert symbolic op codes to binary Assembler
Translates a symbolic assembly language Convert symbolic addresses to binary program into machine language Perform assembler services requested by the Loader pseudo-ops
Reads instructions from the object file and stores them into memory for execution Put translated instructions into a file for future use
Invitation to Computer Science, C++ Version, Third Edition 27 Invitation to Computer Science, C++ Version, Third Edition 28
Operating Systems Functions of an Operating System
Five most important responsibilities of the System commands operating system Carry out services such as translate a program, load a program, run a program User interface management
Types of system commands Program scheduling and activation
Lines of text typed at a terminal Control of access to system and files Menu items displayed on a screen and selected with a mouse and a button: point-and-click Efficient resource allocation
Examined by the operating system Deadlock detection and error detection
Invitation to Computer Science, C++ Version, Third Edition 29 Invitation to Computer Science, C++ Version, Third Edition 30
5 The User Interface
Operating system
Waits for a user command
If command is legal, activates and schedules the appropriate software package
User interfaces Figure 6.15 Text-oriented User Interface Responsibility of the Operating System Graphical
Invitation to Computer Science, C++ Version, Third Edition 31 Invitation to Computer Science, C++ Version, Third Edition 32
System Security And Protection Efficient Allocation Of Resources
The operating system must prevent The operating system ensures that
Non-authorized people from using the computer Multiple tasks of the computer may be underway at one time
User names and passwords Processor is constantly busy
Legitimate users from accessing data or programs Keeps a “queue” of programs that are ready to run they are not authorized to access
Whenever processor is idle, picks a job from the Authorization lists queue and assigns it to the processor
Invitation to Computer Science, C++ Version, Third Edition 33 Invitation to Computer Science, C++ Version, Third Edition 34
The Safe Use Of Resources Historical Overview of Operating Systems Development Deadlock
Two processes are each holding a resource the First generation of system software (roughly other needs 1945–1955)
Neither process will ever progress No operating systems The operating system must handle deadlocks
Deadlock prevention Assemblers and loaders were almost the only Deadlock recovery system software provided
Invitation to Computer Science, C++ Version, Third Edition 35 Invitation to Computer Science, C++ Version, Third Edition 36
6 Historical Overview of Operating Systems Development (continued)
Second generation of system software (1955– 1965)
Batch operating systems
Ran collections of input programs one after the other
Included a command language Figure 6.18 Operation of a Batch Computer System
Invitation to Computer Science, C++ Version, Third Edition 37 Invitation to Computer Science, C++ Version, Third Edition 38
Historical Overview of Operating Historical Overview of Operating Systems Development (continued) Systems Development (continued)
Third-generation operating systems (1965– Fourth-generation operating systems (1985– 1985) present)
Network operating systems Multiprogrammed operating systems Virtual environment treats resources physically residing on the computer in the same way as Permitted multiple user programs to run at once resources available through the computer’s network
Invitation to Computer Science, C++ Version, Third Edition 39 Invitation to Computer Science, C++ Version, Third Edition 40
The Future
Operating systems will continue to evolve
Possible characteristics of fifth-generation systems
Multimedia user interfaces
Parallel processing systems
Figure 6.22 Completely distributed computing environments The Virtual Environment Created by a Network Operating System
Invitation to Computer Science, C++ Version, Third Edition 41 Invitation to Computer Science, C++ Version, Third Edition 42
7 Figure 6.23 Figure 6.24 Structure of a Distributed System Some of the Major Advances in Operating Systems Development
Invitation to Computer Science, C++ Version, Third Edition 43 Invitation to Computer Science, C++ Version, Third Edition 44
Summary Summary
Responsibilities of the operating system System software acts as an intermediary between the users and the hardware User interface management
Assembly language creates a more productive, Program scheduling and activation user-oriented environment than machine
language Control of access to system and files
An assembler translates an assembly language Efficient resource allocation program into a machine language program Deadlock detection and error detection
Invitation to Computer Science, C++ Version, Third Edition 45 Invitation to Computer Science, C++ Version, Third Edition 46
8