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

Similar documents
Lecture 12 Summary. Goals

Computer System Overall Structure Ch 1-8

Systems I: Programming Abstractions

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

CS399 New Beginnings. Jonathan Walpole

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

Lecture 15: I/O Devices & Drivers

Main Points of the Computer Organization and System Software Module

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

CS510 Operating System Foundations. Jonathan Walpole

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

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

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

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

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

RISC Architecture Ch 12

Computer Science (CS)

CS5460: Operating Systems

Operating System Review

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

Memory Hierarchies 2009 DAT105

Understand the factors involved in instruction set

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

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

Last class: OS and Architecture. OS and Computer Architecture

CPS104 Computer Organization Lecture 1

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

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

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.

CO Computer Architecture and Programming Languages CAPL. Lecture 15

CMPSC 311- Introduction to Systems Programming Module: Systems Programming

CS510 Operating System Foundations. Jonathan Walpole

Lecture 4: RISC Computers

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

Assembly Language: Overview!

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

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

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

Chapter 3: Operating-System Structures

Processes. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Disciplina Sistemas de Computação

Chapter 5 Input/Output. I/O Devices

CS 5460/6460 Operating Systems

UNIT- 5. Chapter 12 Processor Structure and Function

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

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

REDUCED INSTRUCTION SET COMPUTERS (RISC)

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

OPERATING SYSTEM OVERVIEW

COMPUTER SCIENCE/INFORMATION SYSTEMS DEGREE PLAN

Real instruction set architectures. Part 2: a representative sample

Instruction Sets Ch 9-10

Lecture 2 Fundamental OS Concepts. Bo 2018, Spring

Instruction Sets Ch 9-10

Introduction to Computers & Programming

MARIE: An Introduction to a Simple Computer

Computer Organization & Assembly Language Programming

CS321 Languages and Compiler Design I. Winter 2012 Lecture 1

Static Program Analysis

ECE 468 Computer Architecture and Organization Lecture 1

Multiple Choice Type Questions

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

An Overview of the BLITZ System

Mon Sep 17, 2007 Lecture 3: Process Management

Hardware Assisted Virtualization

School of Computer Science

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

ECE 3055: Final Exam

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

CPU Structure and Function

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

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

The Operating System. Chapter 6

Summary of Computer Architecture

Compiling Techniques

General Purpose Signal Processors

Computers and Microprocessors. Lecture 34 PHYS3360/AEP3630

The control of I/O devices is a major concern for OS designers

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

Assembly Language. Lecture 2 x86 Processor Architecture

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

Operating Systems (2INC0) 2018/19. Introduction (01) Dr. Tanir Ozcelebi. Courtesy of Prof. Dr. Johan Lukkien. System Architecture and Networking Group

Micro-programmed Control Ch 17

1.Explain with the diagram IVT of 80X86. Ans-

CPSC 341 OS & Networks. Introduction. Dr. Yingwu Zhu

CSC369 Lecture 2. Larry Zhang

Background: Operating Systems

Serial. Parallel. CIT 668: System Architecture 2/14/2011. Topics. Serial and Parallel Computation. Parallel Computing

CSIBridge: Computer Science for Digital Forensics and Cyber Security

Chapter 3: Operating-System Structures

Chapter 12. CPU Structure and Function. Yonsei University

Hardwired Control (4) Micro-programmed Control Ch 17. Micro-programmed Control (3) Machine Instructions vs. Micro-instructions

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

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

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

Instruction Set Principles and Examples. Appendix B

Transcription:

Lecture 12 Summary Main topics What use is this for? What next? Next Courses? Next topics? 1

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 2

What use is this course for? Program execution speed is based on machine instructions executed by the processor (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 3

Main Topics System as a whole, speed differences Example machine and its use Program execution at machine language level Processor, registers, bus, memory 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 4

Example architecture: TTK-91 computer processor - CPU ALU registers CU (libraries) (operating system) memory (cache) MMU program data bus device controllers 5

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 2008: 1 sec 0.5 sec (cache) 10 sec 12 days (register) (memory) (disk) gap gap 0.5 ns? 10 ns? 4 ms? widens widens (50 days?) Michael Crumpton 4 years (web, human) 1 s? (65 yrs?) 6

Assembly language programming for (int i=20; i < 50; ++i) T[i] = 0; variables, constants, arrays (2D), records in memory, 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 7

Parameter types? call-by-value, call-byreference, call-by-name Activation record (Activation record stack) 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 int funca (int x,y); return val param x param y old PC old FP local var i1 local var i2 old R1 old R2-2 +1 8

Instruction fetch-execute cycle get instr PC++ M=2 M>0 decode instr, calc effect addr read from memory M=0 exec. instr pushr write to memory write push pushr D=0 (SR) check for interrupts Fetch Noutosykli Execute 9

Processor execution mode user kernel User mode (normal mode) Can use only ordinary instructions Can reference only user s own memory areas (MMU controls) Privileged or kernel mode When and how mode changes? Can use only all instructions, including privileged instructions (e.g., clear_cache, iret) Can reference all memory areas, including kernel memory Can (also) use direct (physical) memory addresses 10

Data representation formats 1/8 = 0.1250 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 1.1000 12 non-standard data? 3) Leftmost (most significant) 1000 12 which bit (1) data is not is stored (not) understood (implied bit) by the 24 bit mantissa! processor? + 15 0.1875 = 0.0011 11

Process, prosess States and Life Time ready-to-run running create waiting completed or killed When will state change? What happens in state change (at instr. level)? Who or what causes the state change? 12

Prosesses in Queues, PCB R-to-R 1056 1766 Running 0188 Disk1 0036 7654 9878 waiting Timer 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 processor state for this process into processor registers) 13

I/O Implementation, Device Controller and Device Driver Memory bus CPU User process Device driver (OS process) device data c/s device con- troller device controller process device Direct I/O Indirect I/O DMA I/O 14

Disk Use A file is composed of multiple blocks block per disk sector (2-4 sectors?) Disk directory contains information on all blocks used by each file blocks are read in correct order Directory entry FileA (unix) Index block block block block block 15

From High Level Language (HLL) to Execution Compile From HLL Link with other and with library modules Load Into memory as process Compilation unit HLL program or module symbolic address Object module myprog.obj Compiled program (machine code) Linear addresses (per module) Executable myprog.exe Linear addresses (one addr space) some missing (?) Process Executable program Linear addresses (virt. addr space) myprog.c prog.c prog.o math.l prog PCB (prog) 16

Interpretation and Emulation JVM Java virtual machine Java interpreter Pentium II processor ( 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 processor native environment Java byte-code (JIT) compiler dl load module Pentium II processor 17

18

Topic Dependencies Programming Languages Applications Programming Computer Organization Operating Systems Data Communication Computational Theory Concurrency Control Computer Architecture 19

Course Dependencies Compulsory basic and intermediate studies Computer Organization I Advanced studies (in distr syst and data comm) Concurrent Programming Introd. to Data Comm. Comp Org II Introd Data Sec. Oper. Systems Distributed Systems Introd to Spes. & verif 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 processor to execute instructions? How is processor 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? 21

CO-II. [Stal99] 22

Operating Systems (OS), 4 cr 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 More? Distributed Systems, 4 cr 23

OS... 24

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 More? Internet-protocols, 2 cr 25

Introduction to Data Communication TCP/IP -layers Application Applic. interphase Transport layer Network layer Transfer layer application protocols transport protocols network protocols transfer protocols Application Applic. interphase TCP, UDP IP Ethernet, token ring, PPP 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 memory? Messages? Why? Over the network? More? 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 address for this instruction 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 Will it work, if interrupt occurs at bad spot? What is a bad spot? 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 protocols More? Semantics of Programs, 6 cr (lectured 1999) Automatic Verification, 6 cr (lectured 2002) 29

30

Foundation for Computational Theory (2) processor memory fetch instr exec instr 500 million numbers á 10 digits bus processor fetch instr exec instr memory Program P Data bus 31

Computational Theory (5) fetch instr exec instr Program P Data bus Memory contents before P s execution: Memory contents after P s execution: X = very large integer (500M digits?) Y = some other very large integer P is integer valued function P: P: N N Program P representation in memory: 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 memory 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