Assemblers, Compilers, Operating Systems Chapter 6 (Section 6.4 - Optional) Chapter 9 (Section 9.2) Chapter 10 (Section 10.1) Chapter 11 (Sections 11.1,

Slides:



Advertisements
Similar presentations
Def f(n): if (n == 0): return else: print(“*”) return f(n-1) f(3)
Advertisements

Chapter 2 Machine Language.
Delrieu Marjorie Loiseau Pierre
Android architecture overview
Operating System Structure
Chapter 5 Operating Systems. 5 The Operating System When working with multimedia, the operating system is perhaps the most important, the most complex,
Android Aims to bring Internet-style innovation and openness to mobile phones.
The Android Development Environment.  Getting started on the Android Platform  Installing required libraries  Programming Android using the Eclipse.
Programming Creating programs that run on your PC
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
Operating Systems Concepts Professor Rick Han Department of Computer Science University of Colorado at Boulder.
CS211 Data Structures Sami Rollins Fall 2004.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Friday, August 29, 2014 CSCI 351 – Mobile Applications Development.
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
Android GUI Project John Hurley CS 454. Android 1. Android Basics 2. Android Development 3. Android UI 4. Hello, World 5. My Project.
Android Application Development with Java UPenn CS4HS 2011 Chris Murphy
Operating Systems. Software Software – the instructions that make the CPU do useful things Divided into two main categories – System software – Applications.
© Frank Mueller & Seokyong Hong (TA) North Carolina State University Center for Efficient, Secure and Reliable Computing Android Installation Guide (2)
@2011 Mihail L. Sichitiu1 Android Introduction Hello World.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Computer Literacy Chapter 1. IBM 360 ~1970About 2 MB (1/500 GB) memory.
OO Cobol in z/OS.
A-Level Computing types and uses of software. Objectives Know that software can be split into different categories Know what each type of software is.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
10-2 What is the difference between machine code and C? Why use C? How do execution of C and Matlab programs differ? What are three methods of expressing.
High-level Languages.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Android Activities 1. What are Android Activities? Activities are like windows in an Android application An application can have any number of activities.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
MA/CSSE 474 Theory of Computation Course Intro. Today's Agenda Student questions Overview of yesterday's proof –I placed online a "straight-line" writeup.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
1 CSSE 350 Automata, Formal Languages, and Computability.
MODERN OPERATING SYSTEMS Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
Threads and Services. Background Processes One of the key differences between Android and iPhone is the ability to run things in the background on Android.
Lecture 31 Creating Executable Programs on the Mainframe Tuesday, January 20, 2009.
Why Study the Theory of Computation? Implementations come and go. Chapter 1.
Programming Languages
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Monday, August 31, 2012 CSCI 333 – Systems Programming.
MODERN OPERATING SYSTEMS Chapter 1 Introduction
Lecture 1: Network Operating Systems (NOS) An Introduction.
The iOS Platform and SDK. iOS iPhoneiPad Mini iPad.
Operating System Structure Lecture: - Operating System Concepts Lecturer: - Pooja Sharma Computer Science Department, Punjabi University, Patiala.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Introduction to Operating Systems Concepts
Introduction to android
Android Introduction Hello World
Android N Amanquah.
Android Introduction Hello World.
Operating Systems: A Modern Perspective, Chapter 6
Lecture 1 Runtime environments.
תכנות ב android אליהו חלסצ'י.
Android GUI Project John Hurley CS 454.
CMPS 3223 Theory of Computation
MultiUni Trần Vũ Tất Bình
Chapter 1: Intro (excerpt)
Chapter 2: System Structures
Android GUI Project John Hurley CS 454.
CS703 - Advanced Operating Systems
Introduction to Operating Systems
Lecture 1 Runtime environments.
Activities, Fragments, and Intents
Presentation transcript:

Assemblers, Compilers, Operating Systems Chapter 6 (Section Optional) Chapter 9 (Section 9.2) Chapter 10 (Section 10.1) Chapter 11 (Sections 11.1, 11.2)

Layered Systems

Tempus and Hora 1000 parts in a watch

Tempus and Hora Hora Tempus 1 assemply; 1000 parts Prob(no interrupt) = (1 – p) 1000 Cost/interrupt = t * (1/p) p = probability of interruption t = time to add one part 111 assemblies; 10 parts each Prob(no interrupt) = (1 – p) 10 Cost/interrupt = t * 5

Tempus and Hora Hora Tempus 1 assemply; 1000 parts Prob(no interrupt) = (.99) 1000 = 44 * Cost/interrupt = t * (100) p =.01 t = time to add one part 111 assemblies; 10 parts each Prob(no interrupt) = (.99) 10 =.9 Cost/interrupt = t * 5 It will take Tempus 4,000 times as long to build one watch as it takes Hora.

Layered Systems

def rand_simple(): rand = clock() print(rand) strand = str(rand) i = 0 while strand[i] != ".": i +=1 strand = strand[0 : i] + strand[i+1: len(strand)] i = len(strand) while i !=-1 and strand[i-1] !="e": i -= 1 strand = strand[0 : i-1]

Layered Systems 2010: Got recall notice for software patch. 2011: Government report clears electronic components of blame for accelerator problems.

Programming Layers Python Byte codes Machine code …... def factorial(n): result = 1 for j in range(1,n+1): result *= j return (result)

Assembly Language 22 6F B2 1E 24 E6 07 5C FD 3C A B AA 5E AB C 70 DF 32 2D 40 1F 69 C0 8A 7C 0F E9 90 9D 39 2E 4D 1F 60 9A 09 7D 10 4C 93 6F 81 B5 6A 9F 0A 1C AddProduct Jump Next Next: LoadCounter Product Next 

High-Level Languages Over 2500 documented programming languages 1969

High-Level Languages Over 2500 documented programming languages

Fortran real a(4), f(3) c c test of rat c rat = 2.5 f(1) = rat*rat-1. f(2) = rat**4-1. f(3) = rat** read *, (a(i), i = 1, 4) if (a(1).eq. 0.) stop do 2 k = 1, 3 do 2 i = 1, 4-k a(i) = a(i+1)+(a(i+1)-a(i))/f(k) if (a(i).eq. 0.) then print *, 'zero found' else print *, a(i) end if 2 continue go to 1 end

Fortran real a(4), f(3) c c test of rat c rat = 2.5 f(1) = rat*rat-1. f(2) = rat**4-1. f(3) = rat** read *, (a(i), i = 1, 4) if (a(1).eq. 0.) stop do 2 k = 1, 3 do 2 i = 1, 4-k a(i) = a(i+1)+(a(i+1)-a(i))/f(k) if (a(i).eq. 0.) then print *, 'zero found' else print *, a(i) end if 2 continue go to 1 end

Fortran real a(4), f(3) c c test of rat c rat = 2.5 f(1) = rat*rat-1. f(2) = rat**4-1. f(3) = rat** read *, (a(i), i = 1, 4) if (a(1).eq. 0.) stop do 2 k = 1, 3 do 2 i = 1, 4-k a(i) = a(i+1)+(a(i+1)-a(i))/f(k) if (a(i).eq. 0.) then print *, 'zero found' else print *, a(i) end if 2 continue go to 1 end

APL

Returns 1 if the largest element in a three-element vector is greater than the sum of the other two. Otherwise, returns 0.

Java public static double avg(int numbers[]) { double sum = 0; for (double num : numbers) { sum = sum + num; } return sum/numbers.length; }

Matlab function test = InConvexHull (V, vp, vpp) % tests to see if zero is in the convex hull of vpp %ith n of the columns of V and vp % on return % test = 0 indicates zero is not in the convex hull % test = j indicate zero is in the convex hull with %the jth column omitted. % n = size(V); x = -V\vpp; if x>= 0 test = n; else for k = 1:n Vb = [V(:,1:k-1) V(:,k+1:n) vp]; x = -Vb\vpp; test = k; if x >= 0; break; end test = 0; end

Mapping Python to the Machine, or: How Does a Compiler Work? Lexical analysis Parsing Code generation Optimization def easy_sum(n): sum = 0 for i in range(1,n+1): sum += i return(sum)

Mapping Python to the Machine, or: How Does a Compiler Work? Lexical analysis Parsing Code generation Optimization def easy_sum(n): sum = 0 for i in range(1,n+1): sum += i return(sum) def easy_sum ( n ) : sum = 0 for i in range ( 1, n + 1 ) : sum += i return ( sum )

Mapping Python to the Machine, or: How Does a Compiler Work? Lexical analysis Parsing Code generation Optimization def easy_sum(n): sum = 0 for i in range(1,n+1): sum = sum + i return(sum) i = sum +

Mapping Python to the Machine, or: How Does a Compiler Work? Lexical analysis Parsing Code generation Optimization

Mapping Python to the Machine, or: How Does a Compiler Work? Lexical analysis Parsing Code generation Optimization def easy_sum(n): sum = 0 for i in range(1,n+1): sum += i return(sum) LoadSum AddI StoreSum

Mapping Python to the Machine, or: How Does a Compiler Work? Lexical analysis Parsing Code generation Optimization def easy_sum(n): sum = 0 for i in range(1, n+1): sum += i return(sum)

Python is Interpreted, not Fully Compiled

The Operating System (OS)

Managing the User Interface

OS 360 JCL //MYJOB JOB (COMPRESS), 'VOLKER BANDKE',CLASS=P,COND=(0,NE) //BACKUP EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //SYSUT1 DD DISP=SHR,DSN=MY.IMPORTNT.PDS //SYSUT2 DD DISP=(,CATLG), DSN=MY.IMPORTNT.PDS.BACKUP, // UNIT=3350,VOL=SER=DISK01, // DCB=MY.IMPORTNT.PDS, SPACE=(CYL,(10,10,20)) //COMPRESS EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //MYPDS DD DISP=OLD,DSN=*.BACKUP.SYSUT1 //SYSIN DD * COPY INDD=MYPDS,OUTDD=MYPDS //DELETE2 EXEC PGM=IEFBR14 //BACKPDS DD DISP=(OLD,DELETE,DELETE), DSN=MY.IMPORTNT.PDS.BACKUP

MS-DOS and Early PCs

Xerox Alto

The Operating System (OS)

Closer to Home

iPhone vs. Android Apps iOS Apps Android OS

iPhone vs. Android package com.amaanp.helloandroid; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloAndroid extends Activity { /** Called when the activity is first created. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView tv = new TextView(this); tv.setText("Hello, Texas"); setContentView(tv); }

iPhone vs. Android #import window; #pragma mark - #pragma mark Application lifecycle - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(10.0, 30.0f, self.window.frame.size.width, 21.0f)]; label.text World!"; [self.window addSubview:label]; [self.window makeKeyAndVisible]; return YES; } - (void)dealloc { [window release]; [super dealloc];

iPhone vs. Android Apps iOS Apps Android OS iOS simulator

OS Functionality Memory management File system management Process management CPU scheduling I/O device control

Recall the Memory Hierarchy

File System Directory Structure root

File System Directory Structure root

Why Structure?

Organize Permissions

Rooting Your Phone?

Process Management

CPU Management

Modern Operating Systems

The Android Stack

An Aside – Another Open Source Home Run