Chapter 6 An Introduction to System Software and Virtual Machines

Chapter 6 An Introduction to System Software and Virtual Machines

Chapter 6 An Introduction to System Software and Virtual Machines Learning Objectives

Compare the virtual machine created for the user by system software with the naked machine Describe the different types of system software Explain the benefits of writing programs in assembly language rather than machine language Describe how an assembler translates assembly language programs into machine instructions List five key tasks of an operating system, and explain what each is and why it is critical to modern systems Describe the different generations of operating systems,

their features, and how each generation solved a drawback of the previous generation Introduction A naked machine has no tools or programs to help the user:

Write instructions in binary Write data in binary Load instructions into memory one cell at a time Initiate program run Quickly became too difficult for humans to do An interface had to be developed to hide the details and make the computer easier to build System Software (1 of 7)

System software is a collection of programs to: Manage resources of the computer Serve as intermediary between user and hardware System software creates a virtual machine (or a virtual environment) that the user sees System Software (2 of 7) Operating system

single most important piece of software on the computer made up of: The user interface Memory managers I/O systems

Utilities Language services Information managers Scheduler System Software (3 of 7) Communicates with users, determines what they want, and activates other system programs, applications, packages, or user programs System Software (4 of 7)

Language services support high level languages Memory managers allocate memory to programs Information managers organize mass storage Scheduler manages programs waiting to run Utilities: tools, including program libraries

System Software (5 of 7) Graphical user interface (GUI): Pronounced gooey Visual interface to the virtual machine including: Operating system and system programs User programs I/O systems communicate with various devices such as:

Printers Scanners Keyboards Mice System Software (6 of 7) Naked machine 1. Write program in binary 2. Load instructions one by one into memory 3. Insert start into memory address 0 and push go button

4. Read results from memory one by one, in binary System Software (7 of 7) Virtual machine 1. Write program using text editor in high-level language 2. Save program to folder 3. Use translator to convert to binary 4. Use scheduler to load and run 5. Use I/O system to print results Assemblers and Assembly Language (1 of 20)

Low-level programming language is also called assembly language: Instructions map one-to-one to machine language Symbolic op codes (not binary) Symbolic addresses for instructions and data Pseudo-ops for data generation and more (data in human-friendly terms) Advantages over machine code Clarity, readability, and maintainability Can be placed at different locations in memory

Assemblers and Assembly Language (2 of 20) High-level programming languages: Java, C++, and Python Advantages over assembly language: More powerful One high-level instruction may provide multiple machine instructions User oriented

Not machine specific Use both natural language and mathematical notation Assemblers and Assembly Language (3 of 20) Assemblers and Assembly Language (4 of 20) Assembly language process: Source program (assembly language) Translated by the assembler to Object program (machine language)

Loader places in memory Hardware runs Results Assemblers and Assembly Language (5 of 20) Assemblers and Assembly Language (6 of 20) Example assembly language: NEXTSTEP: LOAD X -- Put X into reg. R label: opcode mnemonic address field -- comment Label is optional name for this instructions location

Op code mnemonic and address field translate to machine language Comments are ignored by assemblerjust for human use Assemblers and Assembly Language (7 of 20) Assemblers and Assembly Language (8 of 20) Pseudo-op: commands in the program directed to

the assembler, not converted to machine instructions: .BEGIN and .END to mark where instructions are .DATA to mark memory location as holding data: COUNTER: .DATA 0 X: .DATA 12 Assemblers and Assembly Language (9 of 20)

Assemblers and Assembly Language (10 of 20) Simple examples: x=y+3 input a and b while a > b do print a a=a2 LOAD Y ADD THREE STORE X

-- Data comes after .END X: .DATA 0 -- X is initially 0 Y: .DATA 5 Y is initially 5 THREE: .DATA 3 The constant 3 IN A IN B LOOP1: LOAD A A: .DATA 0 COMPARE B B: .DATA 0 JUMPLT LOOP1END TWO: .DATA 2

JUMPEQ LOOP1END OUT A LOAD A SUBTRACT TWO STORE A JUMP LOOP1 LOOP1END: Assemblers and Assembly Language (11 of 20) Assemblers and Assembly Language (12 of 20)

Assemblers and Assembly Language (13 of 20) Translation and Loading Assembler translates to machine language: Converts symbolic op codes to binary equivalents

Converts symbolic labels to memory addresses Performs pseudo-op actions Writes object file containing machine instructions Loader gets program ready to run: Places instructions in memory Triggers the hardware to run the program Assemblers and Assembly Language (14 of 20)

Converting symbolic op codes to binary ones Assembler maintains a table Assembler looks up symbolic op codes in the table and substitutes the binary analogue Use binary search to optimize table lookups Assemblers and Assembly Language (15 of 20)

Converting symbolic labels to memory addresses Assembler needs two passes Looks over assembly code two times First pass: Keeps a count of how many instructions from the

start Collects symbolic labels and add to symbol table along with location counter Assemblers and Assembly Language (16 of 20) Assemblers and Assembly Language (17 of 20) Assemblers and Assembly Language (18 of 20)

Second pass: Looks up and replace op codes Substitutes label references with location from symbol table Sets up .DATA pseudo-ops with location and binary value Writes instructions to object file

Assemblers and Assembly Language (19 of 20) Assemblers and Assembly Language (20 of 20) Operating Systems (1 of 21) System commands: user instructions about what the computer should do Some typical operating system commands

Load a program Run a program Save information in a file or a directory Retrieve a file previously stored List all the files for this user Delete or rename a file Print a file on a specified I/O device Operating Systems (2 of 21)

Copy a file from one I/O device to another Establish a network connection Let the user set or change a password Tell how much memory or data storage is being used Operating Systems (3 of 21) Functions of an Operating System User interface: user communicates with operating system Operating system as receptionist and dispatcher User command system software scheduled and run repeat

Text-based System commands typed at a prompt in a terminal Command language must be learned GUI-based System commands by a visual/mouse interface

Operating Systems (4 of 21) Operating Systems (5 of 21) System security and protection: permit only authorized access to resources Operating system as a security guard Access protected by usernames and passwords: Superusers have more privileges

Encrypt data to increase security Folders and files have authorization lists: Read a file, add new information to a file, change existing information, and delete a file Operating Systems (6 of 21) Access control list for the file GRADES File: GRADES Name

Permitted Operations Smith R(R=Read Only) Jones RA(A=Append) Adams RAC(C=Change)

Doe RACD(D=Delete) Operating Systems (7 of 21) User interface management (receptionist)

Control of access to system and data files (security guard) Program scheduling activation (dispatcher) Efficient resource allocation (efficiency expert) Deadlock and error detection (traffic officer) Operating Systems (8 of 21) Example of sharing CPU: Waiting Ready Running BA C A makes I/O request: Waiting Ready Running

AC B A finishes with I/O: Waiting Ready Running C B A Operating Systems (9 of 21)

A deadlock occurs when multiple programs are requesting the resources that each one is currently using Safe use of resources: ensure that the computer doesnt get stuck in deadlock Deadlock prevention: if you cant get all resources, release all you have and try again later Deadlock recovery: if no acknowledgement, send message again Operating Systems (10 of 21)

Historical development of operating systems: First generation: nearly naked computer: Programmer hand-loaded programs Second generation: batch operating systems: Programmers gave programs to operators Operators collected a batch of programs

Used I/O computer to translate programs to tape Ran programs as a group Used I/O computer to translate output to text/paper Job control language: instructions to OS Operating Systems (11 of 21) Operating Systems (12 of 21) Operating Systems (13 of 21)

Third generation: multiprogrammed operating systems: Multiple programs loaded at once Switch between programs when I/O happens Computer security now required! Privileged operations only available to the administrator Bound memory a program can legitimately access Operating Systems (14 of 21)

Time-sharing system (also third generation): Multiprogrammed, but users are on the system interactively Users need an illusion of sole access Allocate run time in time sliceseach program runs until I/O OR time runs out Operating Systems (15 of 21) Operating Systems (16 of 21)

Fourth generation: network operating system: Operating system supports all the same local services Also supports services that access resources that are available over a network: Shared printer Servers: email, data, web Connections to the Internet

Real-time operating systems or embedded systems are special-purpose computers in other equipment Operating Systems (17 of 21) Operating Systems (18 of 21) Operating Systems (19 of 21) Fifth generation, the near future:

Multimedia interfaces (integrate images, speech, and video seamlessly) Parallel processing system to perform multimedia and to permit larger scale tasks Distributed computing environment in which users dont know where resources are stored Cloud computing Operating Systems (20 of 21) Operating Systems (21 of 21)

Some of the major advances in operating systems development Generation Approximate Dates Major Advances First 1945-1955 No operating system available Programmers operated the machine themselves

Second 1955-1965 Batch operating systems Improved system utilization Development of the first command language Third 1965-1985

Multiprogrammed operating systems Time-sharing operating systems Increasing concern for protecting programs from damage by other programs Creation of privileged instructions and user instructions Interactive use of computers Increasing concern for security and access control First personal computer operating systems Fourth 1985-present Network operating systems

Client-server computing Remote access to resources Graphical user interfaces Real-time operating systems Embedded systems Fifth ?? Multimedia user interfaces Massively parallel operating systems Distributed computing environments

Summary (1 of 2) System software creates a virtual environment that is easy for users to use. Assemblers and loaders are system software: translate human-friendly programs to machine

language. Assembly language uses symbolic names, symbolic op codes, and pseudo-ops to describe algorithms. Assembler translates source programs to object files; loader places object instructions in memory. Summary (2 of 2)

Operating systems communicate with users through text or GUI actions The operating system includes key tasks such as the user interface, system security, scheduling of programs, and system safety Operating systems developed through four generations of improvements, each adding new features and improving efficiency Future operating systems: parallel, distributed, and multimedia, with resources stored remotely

Recently Viewed Presentations

  • Violence against Women, Domestic Abuse and Sexual Violence ...

    Violence against Women, Domestic Abuse and Sexual Violence ...

    FGM - practiced in UK and US until 1950s as 'cure' for masturbation, lesbianism and promiscuity (Koso-Thomas, O. (1987). ... Change in the manner of dress: for example, clothes which do not suit the climate which may be used to...
  • & the UK Pet Food Industry University Presentation

    & the UK Pet Food Industry University Presentation

    the UK Pet Food Industry. University Presentation. 2015. This presentation, produced and published by PFMA (Pet Food Manufacturers' Association) is aimed at university lecturers and students in the fields of veterinary, veterinary nursing, animal science and other relevant degrees.
  • Solar Photovoltaic with Energy Storage - mragheb.com

    Solar Photovoltaic with Energy Storage - mragheb.com

    "Advanced PV Energy Storage System with Lithium-Ion Batteries", Saft, EUROSOLAR Conference, 31st October 2006 "The Role of Energy Storage in the Modern Low-Carbon Grid", Paul Denholm, National Renewable Energy Laboratory, June 12, 2008 ... Solar Photovoltaic with Energy Storage
  • Social Psychology: Sociological Perspectives

    Social Psychology: Sociological Perspectives

    Social Psychology: Sociological Perspectives David E. Rohall Melissa A. Milkie Jeffrey W. Lucas This multimedia product and its contents are protected under copyright law. The following are prohibited by law: ... LaPiere's Study of Prejudice Richard T. LaPiere (1934) studied...
  • Layout of the year - edurok

    Layout of the year - edurok

    Layout for the year - Grade 9 Practical Projects Balloon Car Project Aeroplane Model Project Theory Workshop safety Drawing & design principles Drawings
  • RAN-EC for volunteers

    RAN-EC for volunteers

    The duty of care is a joint responsibility to provide children and young people with an adequate level of protection against harm. Working as a team. Working together does not remove an individual's responsibility to make a report as a...
  • English-Pitchbook-PRI-Nonhonoring-March-2015

    English-Pitchbook-PRI-Nonhonoring-March-2015

    Nabil FAWAZ. Agribusiness and. General Services +1 202 473 8437 [email protected] . Tim HISTED. Head . South and Southeast Asia +65 9029 4078. [email protected] . Layali ABDEEN. Senior Underwriter. Middle East and North Africa +972 2 236 6571. [email protected]
  • Introduction to Multimedia - Gunadarma

    Introduction to Multimedia - Gunadarma

    Multimedia Design Use Effective Cropping and Image Placement Uncropped image Most of the trees and part of the building are cropped, emphasizing the student Avoid Hyphenation and Underlines Underlined and hyphenated Clear Summary Navigational structures: Linear Hierarchical Non-Linear Composite Storyboarding...