Introduction 2 A Modern Computer iPhone XS Computer Systems and - - PowerPoint PPT Presentation

introduction
SMART_READER_LITE
LIVE PREVIEW

Introduction 2 A Modern Computer iPhone XS Computer Systems and - - PowerPoint PPT Presentation

Computer Systems and Networks ECPE 170 Jeff Shafer University of the Pacific Introduction 2 A Modern Computer iPhone XS Computer Systems and Networks Spring 2019 3 Applications Computer Systems and Networks Spring 2019 4


slide-1
SLIDE 1

ì

Computer Systems and Networks

ECPE 170 – Jeff Shafer – University of the Pacific

Introduction

slide-2
SLIDE 2

A Modern Computer – iPhone XS

Spring 2019 Computer Systems and Networks

2

slide-3
SLIDE 3

Applications

Spring 2019 Computer Systems and Networks

3

slide-4
SLIDE 4

Application – Pokemon Go

ì Written in a high level language (Objective C) ì What resources does Pokemon Go need to run?

(i.e. what does the executable file need to execute?)

ì

Hardware

ì Processor(s) – Run program, display graphics, … ì Memory – Store programs, store data ì I/O – Touch screen, storage, network, 3-axis gyro, …

ì

Software - Operating system

Spring 2019 Computer Systems and Networks

4

slide-5
SLIDE 5

Software - Operating System

ì Apple iOS – Used in iPads, iPhones, iPods, Apple TV

ì

Variant of Mac OS X operating system used on traditional Macs ì What are some jobs of this operating system?

ì

Manage hardware

ì

Manage applications (multitasking) ì Written in high-level languages

ì

C, C++, Objective C (varies by component)

ì

Can we run this code directly on the processor?

Spring 2019 Computer Systems and Networks

5

slide-6
SLIDE 6

Software - Compilers / Interpreters

ì

These are programs that build other programs!

ì

Goal: Convert high-level languages into machine code that can be directly executed by hardware

ì

Examples

ì

Apple Xcode

ì

Microsoft Visual Studio ì

What’s the difference between a compiler and interpreter?

Spring 2019 Computer Systems and Networks

6

slide-7
SLIDE 7

Hardware

Spring 2019 Computer Systems and Networks

7

https://www.ifixit.com/Teardown/iPhone+XS+and+XS+Max+Teardown/113021

slide-8
SLIDE 8

Hardware

Spring 2019 Computer Systems and Networks

8

Apple A12 64-bit Processor + 4GB of RAM (layered) Power Management Audio Amplifiers Power Management Battery Charger

https://www.ifixit.com/Teardown/iPhone+XS+and+XS+Max+Teardown/113021

slide-9
SLIDE 9

iPhone XS Processor

ì Apple A12 Processor

ì

Clock speed – 2.5GHz

ì

6 cores

ì

4GB RAM ì What does a processor do?

ì

Executes machine language instructions

ì Machine language?

ì

How does the processor execute the instructions?

Spring 2019 Computer Systems and Networks

9

What do these mean?

slide-10
SLIDE 10

Microarchitecture

Spring 2019 Computer Systems and Networks

10

slide-11
SLIDE 11

How Does It Work?

ì

Apple won’t tell us – trade secret!

ì

Experts can dissolve (with acid), burn, or grind off

  • uter protective layers of

chip and then peer inside:

ì

Need a really good microscope!

ì

Reverse Engineering in the Semiconductor Industry:

http://www.scribd.com/doc/53 742174/Reverse-Engineering

Spring 2019 Computer Systems and Networks

11

slide-12
SLIDE 12

Spring 2019 Computer Systems and Networks

12

Can see this level of detail with your own eyes… Divided into logic blocks with different functions:

  • Processor
  • Cache memory
  • Memory

Controller

  • Video (GPU)

https://www.anandtech.com/show/13393/techinsights-publishes-apple-a12-die-shot-our-take

slide-13
SLIDE 13

Spring 2019 Computer Systems and Networks

13

SEM Cross-Section of (older) Apple A5

slide-14
SLIDE 14

Digital Logic

Spring 2019 Computer Systems and Networks

14

Memory cell Transistor

slide-15
SLIDE 15

Transistors

Spring 2019 Computer Systems and Networks

15

ì You can still make

assumptions at this level that the transistor is either “on” (1) or “off” (0)

ì But below this are analog

circuits

slide-16
SLIDE 16

The Computer Level Hierarchy

ì Level 6: The User Level – “Pokemon Go”

ì

Program execution and user interface level ì Level 5: High-Level Language Level – “Objective C”

ì

Programming languages like C++, Java, Python, … ì Level 4: Assembly Language Level – “ARM

Assembly”

ì

Program directly at this level, or …

ì

Use a compiler/interpreter to process/convert high- level code

Spring 2019 Computer Systems and Networks

16

User Level High-Level Language Assembly

slide-17
SLIDE 17

The Computer Level Hierarchy

ì Level 3: System Software Level - “iOS”

ì

Controls active programs and manages system resources

ì

Assembly language instructions often pass through Level 3 without modification ì Level 2: Machine Level

ì

Instruction Set Architecture (ISA) Level

ì

Instructions are particular to the architecture of the specific machine (i.e. Intel processors, ARM processors, IBM processors…)

Spring 2019 Computer Systems and Networks

17

User Level High-Level Language Assembly System Machine

slide-18
SLIDE 18

The Computer Level Hierarchy

ì Level 1: Control Level

ì

Decodes and executes instructions and moves data through the system

ì

ECPE 173 – Computer Organization & Architecture ì Level 0: Digital Logic Level

ì

Digital circuits, gates and wires implement the mathematical logic of all other levels

ì

ECPE 71 – Digital Design ECPE 174 – Advanced Digital Design

Spring 2019 Computer Systems and Networks

18

User Level High-Level Language Assembly System Machine Control Digital Logic

These levels are too hardware-oriented for ECPE 170…

slide-19
SLIDE 19

Hardware / Software “Stack”

Spring 2019 Computer Systems and Networks

19

Software Hardware CPU Memory Storage

Disk, SSD

GPU Network

User-Space (“Applications”) Kernel-Space (“OS”)

Operating System

Shell (Bash) Terminal Firefox

LibreOffice

Device Drivers

slide-20
SLIDE 20

ì

Course Overview

Spring 2019 Computer Systems and Networks

20

slide-21
SLIDE 21

Motivating Question

ì What do you, as a programmer, need to know

about the underlying system (software and hardware) to write more efficient code?

ì

Role of the tools

ì Compiler, assembler, linker, profiler

ì

Role of the operating system and its efficient usage

ì

Assembly programming (using the CPU efficiently)

ì

Memory hierarchy and its impact on performance

Spring 2019 Computer Systems and Networks

21

slide-22
SLIDE 22

Course Goals

ì

Present a complete view of how computer systems are constructed

ì

From the CPU assembly programming level to the user application level ì

Understand the relationship between computer software and hardware

ì

Lay the foundation for future courses

ì

Advanced Digital design / VLSI

ì

Operating systems

ì

Computer networking

ì

Application development

22

Spring 2019 Computer Systems and Networks

slide-23
SLIDE 23

C Programming Language

ì

Why not Python, Java, Ruby, Perl, PHP, …?

ì

High-level languages (especially interpreted, managed code…) try to hide the underlying machine from you

ì

ECPE 170 wants to reveal the underlying machine to you!

ì

Industry demand for systems programmers

Spring 2019 Computer Systems and Networks

23

C

slide-24
SLIDE 24

Linux

ì Course will be taught 100%

in Linux

ì

Did you have to choose Linux for ECPE 170?

ì

No, not really, but…

ì

Too many Pacific graduates were escaping without a working knowledge!

ì

Feedback from co-op employers and graduates: “More Linux/Unix skills please!”

Spring 2019 Computer Systems and Networks

24

slide-25
SLIDE 25

Linux

ì

Who here has used a Linux desktop/laptop/server before?

ì

Who here has used a Linux “device” before?

ì

I’d be surprised if it isn’t everyone…

ì

Android runs a Linux kernel

ì

Amazon Kindle runs a Linux kernel

ì

TiVO runs a Linux kernel

Spring 2019 Computer Systems and Networks

25

slide-26
SLIDE 26

Discussion

ì What is open-source? ì What is an operating system kernel?

ì

Is the kernel everything you need from an OS? ì What is Linux? ì What is Ubuntu Linux? (RedHat? Debian? …)

ì

à Show family tree of distributions ß

Spring 2019 Computer Systems and Networks

26

slide-27
SLIDE 27

Virtual Machine

ì Course will be taught 100%

from a virtual machine booting Linux that you install!

ì

Couldn’t you just give us remote access to a server someplace that is already configured?

ì

Yes, but…

ì

By installing it yourself you will have the skills to use it again in the future

Spring 2019 Computer Systems and Networks

27

slide-28
SLIDE 28

Discussion

ì What is a Virtual Machine? ì How is it different from dual booting? ì Which comes first, the virtual machine, or the OS?

ì

Answer: It depends!

ì

Typical desktop install: hosted virtualization

ì

Typical server install: bare-metal virtualization

Spring 2019 Computer Systems and Networks

28

slide-29
SLIDE 29

Hosted Virtualization

Spring 2019 Computer Systems and Networks

29

Recommended technique for ECPE 170

slide-30
SLIDE 30

Bare-Metal Virtualization

Spring 2019 Computer Systems and Networks

30

More efficient, but not as easy to install. The virtual machine monitor acts like an

  • perating

system itself!

slide-31
SLIDE 31

Version Control

ì Course will use version control!

ì

Only way to get lab code or turn in assignments

ì

Did you have to mandate VCS for ECPE 170?

ì

No, not really, but…

ì

Too many Pacific graduates were avoiding learning this on their own!

ì

Feedback from co-op employers and graduates: “Only n00bs work without version control!”

ì

Used everywhere: Source code of all kinds! (C++, Python, Matlab, VHDL/Verilog, …)

Spring 2019 Computer Systems and Networks

31

slide-32
SLIDE 32

Version Control

ì

Who here has used a version control system before?

ì

What system?

ì

Where at?

ì

What purpose?

Spring 2019 Computer Systems and Networks

32

slide-33
SLIDE 33

Questions?

ì Questions? ì Concerns?

Spring 2019 Computer Systems and Networks

33

slide-34
SLIDE 34

ì

Course Mechanics

Spring 2019 Computer Systems and Networks

34

slide-35
SLIDE 35

Websites

Spring 2019 Computer Systems and Networks

35

  • http://ecs-network.serv.pacific.edu/ecpe-170

Main website (syllabus, schedule)

  • http://canvas.pacific.edu

Canvas website (gradebook)

  • http://bitbucket.org

Bitbucket.org (version control)

slide-36
SLIDE 36

Textbook

ì No official textbook

ì

Optional reference books (useful for this class and beyond)

ì

The C Programming Language, 2nd Edition ì

Please suggest useful online

  • r print references

throughout the semester

Spring 2019 Computer Systems and Networks

36

slide-37
SLIDE 37

Grading

ì

30% - Exams

ì

15% - Mid-term exam

ì

15% - Final exam

ì

65% - Labs

ì

Points assigned to each lab will vary based on complexity

ì

Each lab begins as an in-class activity

ì

Unfinished work becomes homework/project

ì

Labs are large – assume “the usual” amount of homework/projects for a 4-credit class ì

Tip: The best students last semester started the labs

  • utside of class, and finished them as an in-class activity

ì

5% - In-Class Participation

Spring 2019 Computer Systems and Networks

37

slide-38
SLIDE 38

Class Attendance

ì See class schedule on website ì Strong – Class will have significant new lecture

content or in-class participation problem

ì Moderate – Class will have significant lab activity ì Recommended – Students have the option of

performing their work outside of the class, as long as they are confident in performing the required task on their own

Spring 2019 Computer Systems and Networks

38

slide-39
SLIDE 39

Honor Code

ì All assignments are submitted individually ì Encouraged Activities

ì

Collaborating with your classmates (asking questions, solving problems together)

ì

Searching for solutions online

ì Provided code copied does not exceed 25% of total

assignment length

ì Provided you clearly document this copy in your

source code and lab report

ì What did you copy? Where did it come from?

Spring 2019 Computer Systems and Networks

39

slide-40
SLIDE 40

Honor Code

ì Risky Activities

ì

Having your classmates type on your computer or assignment file ì Forbidden Activities

ì

Copying someone’s work verbatim (classmate or

  • therwise)

ì

Copying someone’s work and obfuscating its source ì Your code will be checked for similarity with other

submissions with an automated tool. More than a 30% match on non-trivial code is a red flag.

Spring 2019 Computer Systems and Networks

40

slide-41
SLIDE 41

Lab Topics

1.

Linux

2.

Version Control

3.

C Programming

4.

C Programming Project

5.

Performance Measurement

6.

Performance Optimization (compiler and programmer techniques)

7.

Performance Optimization (Memory systems)

8.

Network Programming 1 (Python)

9.

Network Programming 2

  • 10. Assembly Programming 1

(MIPS)

  • 11. Assembly Programming 2
  • 12. Assembly Programming 3

Spring 2019 Computer Systems and Networks

41

slide-42
SLIDE 42

Class Time

ì The goal* in designing this course:

Spring 2019 Computer Systems and Networks

42

* Actual time in any specific class may vary

0% 25% 50% 75% 100% Me Talking You Doing (Hands-on activities)

slide-43
SLIDE 43

ì

Lab 1 - Linux

Spring 2019 Computer Systems and Networks

43

slide-44
SLIDE 44

Homework

ì Before the next class

1.

Skim “Virtual Machine Setup” tutorial instructions

  • n website

ì http://ecs-network.serv.pacific.edu/ecpe-

170/tutorials/vm_setup 2.

Decide on what computer system you want to use for this class

3.

Download all software

ì Virtual machine installer (VMWare Player) ì Linux .iso image (installer) – 64-bit version

Spring 2019 Computer Systems and Networks

44

slide-45
SLIDE 45

Next Class - Linux Installfest

ì Tutorial Day ì Objectives

ì

Follow the “Virtual Machine Setup” tutorial from website to install Linux

ì

Debug individual problems if needed

ì

Verify OS works

ì

Submit screenshot to “Pre-Lab 1” assignment on Canvas as proof of success

Spring 2019 Computer Systems and Networks

45

slide-46
SLIDE 46

Next Class - Linux Installfest

ì I want you to be comfortable as professionals

working independently to solve problems

ì If you complete the “Virtual Machine Setup”

tutorial independently (and submit to Canvas a screenshot by Thursday morning), you don’t need to attend Thursday’s class.

ì I will still be here to answer all questions and solve

problems

Spring 2019 Computer Systems and Networks

46

slide-47
SLIDE 47

Next Class - Linux Installfest

ì Warning: Don’t skip class Thursday, and

then tell me next Tuesday at Lab #1 that your OS doesn’t work!

Spring 2019 Computer Systems and Networks

47

slide-48
SLIDE 48

Lab 1 - Linux

ì The first lab is next Tuesday

ì

Topic: Linux

ì

Crash course in command-line usage ì Lab 1: Pre-Lab

ì

Submit to Canvas the screenshot of your working command prompt in Linux. Hopefully you will have this done by end-of-class Thursday

ì

Pre-Lab is due at the start of the lab

Spring 2019 Computer Systems and Networks

48

slide-49
SLIDE 49

Bring Laptop!

Spring 2019 Computer Systems and Networks

49

Every class – bring your laptop

slide-50
SLIDE 50

Bring Laptop!

Spring 2019 Computer Systems and Networks

50

Every class – bring your laptop!

slide-51
SLIDE 51

Bring Laptop!

Spring 2019 Computer Systems and Networks

51

Every class – bring your laptop!!

(*) Maybe not this one, but you get the idea…

slide-52
SLIDE 52

Bring Laptop!

Spring 2019 Computer Systems and Networks

52

Every class – bring your laptop!! Just assume we’ll do at least some lab activity in class unless it’s been made crystal clear in advance that a day will be all lecture/discussion instead…

slide-53
SLIDE 53

Questions?

ì Questions? ì Concerns?

Spring 2019 Computer Systems and Networks

53