Lecture 12 Summary. Goals

Similar documents
Lecture 12 Summary. Main topics What use is this for? What next? Next Courses? Next topics? Teemu Kerola, Copyright 2010

Computer System Overall Structure Ch 1-8

Systems I: Programming Abstractions

Topics. Structured Computer Organization. Assembly language. IJVM instruction set. Mic-1 simulator programming

Questions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation. What s in a process? Organizing a Process

CS510 Operating System Foundations. Jonathan Walpole

CS399 New Beginnings. Jonathan Walpole

Windows 7 Overview. Windows 7. Objectives. The History of Windows. CS140M Fall Lake 1

Topics Power tends to corrupt; absolute power corrupts absolutely. Computer Organization CS Data Representation

Basic Concepts COE 205. Computer Organization and Assembly Language Dr. Aiman El-Maleh

Main Points of the Computer Organization and System Software Module

Lecture 15: I/O Devices & Drivers

RISC Architecture Ch 12

Overview of the ECE Computer Software Curriculum. David O Hallaron Associate Professor of ECE and CS Carnegie Mellon University

Virtual Memory (VM) Ch Copyright Teemu Kerola Teemu s Cheesecake

Operating System Review

CS 333 Introduction to Operating Systems Class 2 OS-Related Hardware & Software The Process Concept

Computer Science (CS)

Last class: OS and Architecture. OS and Computer Architecture

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components

OS and Computer Architecture. Chapter 3: Operating-System Structures. Common System Components. Process Management

CS5460: Operating Systems

Lecture 4: Memory Management & The Programming Interface

Instruction Set Design

CSE 237B Fall 2009 Virtualization, Security and RTOS. Rajesh Gupta Computer Science and Engineering University of California, San Diego.

Understand the factors involved in instruction set

Memory Hierarchies 2009 DAT105

CO Computer Architecture and Programming Languages CAPL. Lecture 15

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

CMPSC 311- Introduction to Systems Programming Module: Systems Programming

CPS104 Computer Organization Lecture 1. CPS104: Computer Organization. Meat of the Course. Robert Wagner

Lecture 4: RISC Computers

Chapter 5 (Part II) Large and Fast: Exploiting Memory Hierarchy. Baback Izadi Division of Engineering Programs

CPS104 Computer Organization Lecture 1

Virtual Memory (VM) Ch 7.3

Teemu s Cheesecake. Virtual Memory (VM) Ch 7.3. Other Problems Often Solved with VM (3) Virtual Memory Ch 7.3

Chapter 3: Operating-System Structures

Processes. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

x86 segmentation, page tables, and interrupts 3/17/08 Frans Kaashoek MIT

REDUCED INSTRUCTION SET COMPUTERS (RISC)

2 nd Half. Memory management Disk management Network and Security Virtual machine

OPERATING SYSTEM OVERVIEW

CS510 Operating System Foundations. Jonathan Walpole

Introduction to Computers & Programming

Computer Organization & Assembly Language Programming

CS321 Languages and Compiler Design I. Winter 2012 Lecture 1

Static Program Analysis

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

An Overview of the BLITZ System

Assembly Language: Overview!

School of Computer Science

Hardware Assisted Virtualization

CSE 410 Final Exam 6/09/09. Suppose we have a memory and a direct-mapped cache with the following characteristics.

Disciplina Sistemas de Computação

System that permanently stores data Usually layered on top of a lower-level physical storage medium Divided into logical units called files

CS 5460/6460 Operating Systems

Compiling Techniques

The Operating System. Chapter 6

Lecture 2 Fundamental OS Concepts. Bo 2018, Spring

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

COMPUTER SCIENCE/INFORMATION SYSTEMS DEGREE PLAN

UNIT- 5. Chapter 12 Processor Structure and Function

MARIE: An Introduction to a Simple Computer

Real instruction set architectures. Part 2: a representative sample

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10

CSC369 Lecture 2. Larry Zhang

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

Background: Operating Systems

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

Chapter 3: Operating-System Structures

Chapter 5 Input/Output. I/O Devices

Administrative Details. CS 140 Final Review Session. Pre-Midterm. Plan For Today. Disks + I/O. Pre-Midterm, cont.

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

Instruction Set Principles and Examples. Appendix B

ECE 468 Computer Architecture and Organization Lecture 1

Recall: Paging. Recall: Paging. Recall: Paging. CS162 Operating Systems and Systems Programming Lecture 13. Address Translation, Caching

CS 333 Introduction to Operating Systems. Class 2 OS-Related Hardware & Software The Process Concept

COS 140: Foundations of Computer Science

Chapter 3: Operating-System Structures

Multiple Choice Type Questions

CSC 4320 Test 1 Spring 2017

Mon Sep 17, 2007 Lecture 3: Process Management

Floating Point Arithmetic

CHAPTER 1 Introduction to Computers and Java

Institute of Engineering & Management. Course:CS603- Operating System. Course pre-requisites

Virtualization. Operating Systems, 2016, Meni Adler, Danny Hendler & Amnon Meisels

Memory: Overview. CS439: Principles of Computer Systems February 26, 2018

CS350: Final Exam Review

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics

Summary of Computer Architecture

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set?

Memory Hierarchy and Cache Ch 4-5. Memory Hierarchy Main Memory Cache Implementation

Syllabus for Computer Science General Part I

Computers and Microprocessors. Lecture 34 PHYS3360/AEP3630

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

General Purpose Signal Processors

Transcription:

Main topics What use is this for? What next? Next Courses? Next topics? Lecture 12 Summary Goals To understand basic features of a computer system, from the point of view of the executing program To understand, how a computer systems executes the program given to it To understand the execution time program representation in system To understand the role and basic functionalities of the operating system 1 2 What use is this course for? Program execution speed is based on machine instructions executed by the (CPU), and not in the program representation format in high level language High level language representation is still important Understanding higher level topics is easier, once one first understands what happens at lower levels of the system Main Topics System as a whole, speed differences Example machine and its use Program execution at machine language level Processor, registers,, Fetch-execute cycle, interrupts Activation record stack, subroutine implementation Data representation formats (program vs. hardware) I/O devices and I/O implementation Device drivers, I/O interrupts, disk drive Operating system fundamentals Process and its implementation (PCB) Execution of programs in the system Compilation, linking, loading Interpretation, emulation, simulation Examples on the following slides 3 4 Example architecture: TTK-91 computer - CPU ALU CU registers (libraries) (operating system) Speed differences: Teemu s Cheese Cake The speed of registers, cache, disk drive and web as compared to finding cheese for cheese cake. Europa Refridge- (Jupiter) hand table rator Moon (cache) MMU program data device controllers 2008: 0.5 sec (register) 1 sec (cache) 10 sec 12 days () (disk) gap gap 0.5 ns? 10 ns? 4 ms? widens widens (50 days?) Michael Crumpton 4 years (web, human) 1 s? (65 yrs?) 5 6 Lecture 12, Summary 1

Assembly language programming for (int i=20; i < 50; ++i) T[i] = 0; variables, constants, arrays (2D), records in, in registers? selection, loops, subroutines, SVC s, parameters, local variables I DC 0 LOAD R1, =20 STORE R1, I Loop LOAD R2, =0 LOAD R1, I STORE R2, T(R1) LOAD R1, I ADD R1, =1 STORE R1, I LOAD R3, I COMP R3, =50 JLES Loop Parameter types? call-by-value, call-byreference, call-by-name Activation record (Activation record stack) int funca (int x,y); Subroutine implementation (ttk-91) function return value (or all return values) all (input and output) parameter values return address previous activation record all local variables and data structures saved registers values for recovering them at return return val param x param y old PC old FP local var i1 local var i2 old R1 old R2-2 +1 7 8 Instruction fetch-execute cycle get instr PC++ Fetch Noutosykli M=2 M>0 decode instr, calc effect addr read from M=0 exec. instr Execute pushr write to write push pushr D=0 (SR) check for interrupts Processor execution mode User mode (normal mode) Can use only ordinary instructions Can reference only user s own areas (MMU controls) Privileged or kernel mode user Can use only all instructions, including privileged instructions (e.g., clear_cache, iret) Can reference all areas, including kernel kernel When and how mode changes? Can (also) use direct (physical) addresses 9 10 Data representation formats 1/8 = 0.1250 + 15 0.1875 = 0.0011 1/16= 0.0625 0.1875 sign exponent mantissa or significand integers 23 bits to mantissa, so that... floating points 1) character Binary point (.) is immediately mantissa exponent character after the first strings bit 0.0011 15 pictures, sounds 2) Mantissa is normalized: leftmost bit is 1 non-standard data? 1.1000 12 3) Leftmost (most significant) 1000 12 which bit (1) data is not is stored (not) understood (implied bit) by the 24 bit mantissa!? 11 Process, prosess States and Life Time create ready-to-run waiting running When will state change? What happens in state change (at instr. level)? Who or what causes the state change? completed or killed 12 Lecture 12, Summary 2

R-to-R waiting Prosesses in Queues, PCB 1056 1766 Running 0188 Disk1 Timer 0036 7654 9878 0555 Msg from 1345 2222 Prosess 9878 descriptor (PCB) scheduling: select next process in Ready-to-Run queue and move it to CPU for execution (copy state for this process into registers) I/O Implementation, Device Controller and Device Driver Memory device CPU data c/s device con- troller device controller process User process Device driver (OS process) device Direct I/O Indirect I/O DMA I/O 13 14 Disk Use A file is composed of multiple s per disk sector (2-4 sectors?) Disk directory contains information on all s used by each file s are read in correct order Directory entry FileA (unix) Index 15 From High Level Language (HLL) to Execution Compile From HLL Link with other and with library modules Load Into as process Compilation unit HLL program or module symbolic address Executable myprog.exe Linear addresses (one addr space) some missing (?) Process Executable program Linear addresses (virt. addr space) myprog.c prog.c Object module myprog.obj prog.o Compiled program (machine code) Linear addresses (per module) math.l prog PCB (prog) 16 Interpretation and Emulation JVM Java virtual machine Java interpreter Pentium II ( example) load iload i iload j iadd istore k k = i+j; Java program Java byte code compilation iload i iload j iadd istore k Java native environment Java byte-code (JIT) compiler dl load module Pentium II 17 18 Lecture 12, Summary 3

Topic Dependencies Programming Languages Operating Systems Data Communication Computational Theory Programming Computer Organization Applications Concurrency Control Computer Architecture 19 Introd Data Sec. Compulsory basic and intermediate studies Oper. Systems Course Dependencies Computer Organization I Concurrent Programming Distributed Systems Introd. to Data Comm. Introd to Spes. & verif Advanced studies (in distr syst and data comm) Comp Org II Internet Protocols 20 Computer Organization II, 4 cr 2 nd year students Elective course in BSc or MSc studies Prerequisites: CO-I In most universities combined with CO-I One level down from CO-I in implementation hierarchy How will hardware clock cycle make the to execute instructions? How is arithmetic implemented? Many instructions in execution concurrently (in many ways!) How is this implemented, what problems does it cause, and how are those problems solved? CO-II. [Stal99] 21 22 Operating Systems (OS), 4 cr OS... 4 th year students Compulsory for graduate (M.Sc.) students of the distributed systems and telecommunication specialisation area Prerequisites CO-I Concurrent Programming Introduction to Data Communication OS role as process and resource controller Concurrent processes using shared resources Use of system resources Process scheduling Distributed Systems, 4 cr 23 24 Lecture 12, Summary 4

Intro to Data Communication, 4 cr 2 nd year students Obligatory undergraduate course Computer network basic services to users and applications Basic tools for data communication Network architecture layer structure and services at each layer Internet-, 2 cr Introduction to Data Communication Application Applic. interphase Transport layer Network layer Transfer layer TCP/IP -layers application transport network transfer Application Applic. interphase TCP, UDP IP Ethernet, token ring, PPP 25 26 Concurrent Programming (CP), 4 cr 2 nd year students Obligatory undergraduate course Prerequisites: CO-I Problems caused by concurrency System just freezes why? Concurrency requirements for system Process synchronization Busy wait or process switch? Why? Prosess communication Shared? Messages? Why? Over the network? Distributed Systems, 4 cr semaphores monitors rendezvous guarded statements rpc, messages Java concurrent progr. 27 CP - Synchronization Problem Solution with Test-and-Set Instruction TAS Ri, L (ttk-91 extension) Critical section Will it work, if interrupt occurs at bad spot? What is a bad spot? Ri := mem[l] if Ri==1 then {Ri := 0, mem[l] := Ri, jump *+2} LOOP: TAS R1, L # L: 1 (open) 0 (locked) JUMP LOOP # wait until lock open... # lock is locked for me critical section: one? process at a time... LOAD R1,=1 # open lock L STORE R1,L address for this instruction 28 An Introduction to Specification and Verification, 4 cr 4 th year students Elective graduate level (M.Sc.) course Prerequisites Understanding the problematics of distribution and concurrency Introduction to Data Communication, Concurrent Programming Model processes with transitional systems step: machine instruction? Method? Transaction? Program? Principles of automatic verification Verification of simple Semantics of Programs, 6 cr (lectured 1999) Automatic Verification, 6 cr (lectured 2002) 29 30 Lecture 12, Summary 5

Foundation for Computational Theory (2) fetch instr exec instr fetch instr exec instr 500 million numbers á 10 digits Program P Data 31 Computational Theory (5) fetch instr exec instr Memory contents before P s execution: Memory contents after P s execution: P is integer valued function P: Program P Data X = very large integer (500M digits?) Y = some other very large integer P: N N Program P representation in : large integer, P P N 32 Computational Theory... (5) Properties of any programs can be deduced from properties of integers or integer valued functions computational theory Proven properties of programs (any programs) valid for all computers valid always: now and in future 33 Proven theorems in computational theory and algorithm analysis (4) With any preselected time span or size, there exists a problem such that (1) it has a solution, and (2) all programs solving it will take more time or space than those preselected maximum limits There exists programs that can never be solved with any computer There exists a large class of know problems such that we do not yet know how difficult they really are? P = NP 34 -- End of Lecture 12 and End of Course -- http://www.retroweb.com/apollo_retrospective.html http://study.for.exam.edu/intime.html 35 Lecture 12, Summary 6