Lecture 1. Embedded Systems vs General-Purpose Systems

Slides:



Advertisements
Similar presentations
HARDWARE Rashedul Hasan..
Advertisements

1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory Management and Protection Part 3:Virtual memory, mode switching,
Lecture 0. Course Introduction
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University ECM553 Special Topics in Computer Science 1.
Embedded System Lab. What is an embedded systems? An embedded system is a computer system designed for specific control functions within a larger system,
Implementing Fault Tolerant Systems with Windows CE.NET Reliable System Design 2010 by: Amir M. Rahmani.
Intel MP.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University ECM534 Advanced Computer Architecture.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
Component 4: Introduction to Information and Computer Science Unit 1: Basic Computing Concepts, Including History Lecture 1 This material was developed.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
CMPTR1 CHAPTER 3 COMPUTER SOFTWARE Application Software – The programs/software/apps that we run to do things like word processing, web browsing, and games.
Chapter 13 Embedded Systems
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
Microcontroller: Introduction
Lecture 0. Course Introduction
S3 Computer Literacy Computer Hardware. Overview of Computer Hardware Motherboard CPU RAM Harddisk CD-ROM Floppy Disk Display Card Sound Card LAN Card.
Mobile Handset Hardware Architecture
Lecture 1. Embedded Systems vs General-Purpose Systems
Computer for Health Sciences
Lecture 2. General-Purpose (GP) Computer Systems Prof. Taeweon Suh Computer Science Education Korea University COMP427 Embedded Systems.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Lecture 5. AT91 - Memory Map, Timers, and AIC -
Lecture 1. Embedded Systems vs General- Purpose Systems Prof. Taeweon Suh Computer Science Education Korea University COM609 Topics in Embedded Systems.
Lecture 2. General-Purpose (GP) Computer Systems Prof. Taeweon Suh Computer Science Education Korea University ECM586 Special Topics in Embedded Systems.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University ECM586 Special Topics in Embedded Systems.
Computer Hardware Mr. Richard Orr Technology Teacher Bednarcik Jr. High School.
Lecture 1. What is Embedded System? Prof. Taeweon Suh Computer Science & Engineering Korea University COMP427 Embedded Systems.
Organization of a computer: The motherboard and its components.
Lecture 1. x86 General-purpose vs Embedded Systems
Computer system components By Corey Burton. GPU GPU stands for ‘graphics processing unit’. The GPU can help the computer run smoothly. GPU is used for.
A+ Guide to Software Managing, Maintaining and Troubleshooting THIRD EDITION Chapter 2 How an OS Works with Hardware and Other Software.
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Sogang University Advanced Computing System Chap 1. Computer Architecture Hyuk-Jun Lee, PhD Dept. of Computer Science and Engineering Sogang University.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University ECM585 Special Topics in Computer Design.
Module 2 : Part 1 INTRODUCTION TO HARDWARE & SOFTWARE INTRODUCTION TO HARDWARE & SOFTWARE.
Foundation year Lec.3: Computer SoftwareLec.3: Computer Software Lecturer: Dalia Mirghani Year: 2014/2015.
Lecture 0. Program Introduction Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
1 THE COMPUTER. 2 Input Processing Output Storage 4 basic functions.
© GCSE Computing Computing Hardware Starter. Creating a spreadsheet to demonstrate the size of memory. 1 byte = 1 character or about 1 pixel of information.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University ECM583 Special Topics in Computer Systems.
Lecture 1. General-Purpose Computer Systems
Lecture on Central Process Unit (CPU)
Week1: Introduction to Computer Networks. Copyright © 2012 Cengage Learning. All rights reserved.2 Objectives 2 Describe basic computer components and.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University COM515 Advanced Computer Architecture.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
SEPTEMBER 8, 2015 Computer Hardware 1-1. HARDWARE TERMS CPU — Central Processing Unit RAM — Random-Access Memory  “random-access” means the CPU can read.
Lecture 2. General-Purpose Computer Systems Prof. Taeweon Suh Computer Science Education Korea University ECM586 Special Topics in Embedded Systems.
1 Lesson 1 Computers and Computer Systems Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Lecture 01: Computer Architecture overview. Our Goals ● Have a better understanding of computer architecture – Write better (more efficient) programs.
Lecture 1. What is Embedded System?
Embedded Operating system GROUP NO. 3 HAMZA MEHMOOD AHMED SAAD.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science & Engineering Korea University COSE222, COMP212, CYDF210 Computer Architecture.
CT101: Computing Systems Introduction to Operating Systems.
Voice Controlled Robot by Cell Phone with Android App
Lecture 2. A Computer System for Labs
Computer systems is a 10-credit unit
Chapter Objectives In this chapter, you will learn:
CS111 Computer Programming
Computer Organization & Assembly Language Chapter 3
Today’s agenda Hardware architecture and runtime system
2.C Memory GCSE Computing Langley Park School for Boys.
Course Code 114 Introduction to Computer Science
Presentation transcript:

Lecture 1. Embedded Systems vs General-Purpose Systems COM609 Topics in Embedded Systems Lecture 1. Embedded Systems vs General-Purpose Systems Prof. Taeweon Suh Computer Science Education Korea University

Embedded Systems Embedded systems are virtually everywhere in your life Embedded systems cover a wide range of electronics gadgets such as iPhone, Android phone, GPS, Refrigerator, Washer, TV..

Embedded Systems Embedded System is a special-purpose computer system designed to perform one or a few dedicated functions - Wikipedia Embedded System market is super competitive

iPhone Generations Original iPhone (iPhone 2G) June 2007 iPhone 3G iPhone 3GS June 2009 iPhone 4 June 2010 Sep. 2012 iPhone 5 Oct. 2011 iPhone 4S http://apple.wikia.com/wiki/IPhone_3G http://en.wikipedia.org/wiki/History_of_the_iPhone

Smartphone War http://www.sleetherz.com/2011/10/smartphone-war-in-fatal-three-way-iphone-4s-vs-droid-razr-vs-galaxy-nexus/

Embedded Systems Even though embedded systems cover a wide range of special-purpose systems, there are common characteristics Low cost Should be cheap to be competitive Memory is typically very small compared to a general purpose computer system Lightweight processors are used in embedded systems Low power Should consume low power especially in case of portable devices Low-power processors are used in embedded systems

Embedded Systems (Cont) High performance Should meet the computing requirements of applications Users want to watch video on portable devices Audio should be in sync with video Gaming gadgets like playstation should provide high performance Real-time property Job should be done within a time limit Aerospace applications, Car control systems, Medical gadgets are critical in terms of time constraint – Otherwise, it could lead to catastrophe such as loss of life Will talk more about this

Embedded Systems (Cont) It is challenging to satisfy the characteristics You may not be able to achieve high performance while utilizing cheap components and maintaining low power consumption So, you got to do your best in a given circumstance to be competitive in the market

HW/SW Stack of Embedded Systems Identical to the general computer systems Application Software OS / Device Drivers Hardware

Components of Embedded Systems Hardware It is mainly composed of processor (1 or more), memory, I/O devices including network devices, timers, sensors etc.

iPhone 4 Teardown http://www.ifixit.com/Teardown/iPhone-4-Teardown/3130/1 http://news.cnet.com/8301-13924_3-20006904-64.html GSM (Global System for Mobile communications): 2G, 3G, 4G .. UMTS (Universal Mobile Telecommunications Systems): one of 3G technologies being developed into 4G

iPhone 4 Teardown 512MB Mobile DDR Audio Codec (Cirrus Logic) Samsung flash memory (32GB): K9PFG08 Audio Codec (Cirrus Logic) 512MB Mobile DDR A4 Processor (ARM Cortex A8) designed by Apple manufactured by Samsung GSM and more GSM (Global System for Mobile communications): 3G

iPhone 4 Teardown Accelerometer detects when the user has rotated the device from portrait to landscape, then automatically changes the contents of the display accordingly Proximity sensor detects when you lift iPhone to your ear and immediately turns off the display to save power and prevent inadvertent touches until iPhone is moved away Ambient light sensor automatically adjusts the display’s brightness to the appropriate level for the current ambient light, enhancing the user experience and saving power at the same time

iPhone 5 Teardown Accelerometer Touchscreen controller A6 application processor, based off the ARMv7 ISA 1GB Elpida LP (Low Power) DDR2 integrated according to Chipworks LTE modem 16GB NAND Flash from Hynix Wi-Fi module 3-axis gyroscope http://www.ifixit.com/Teardown/iPhone+5+Teardown/10525/2

Galaxy S3 Teardown Samsung 16GB eMMC (MultiMediCard) + 64MB NAND Flash Intel Wireless Processor Exynos 4412: Quad-core A9 with 1GB DDR2 http://www.ifixit.com/Teardown/Samsung-Galaxy-S-III-Teardown/ http://www.samsung.com/

Exynos 4412 Block Diagram PoP: Package-on-Package What is PoP Memory? DECEMBER 19, 2009 Package-on-Package or (PoP) memory was created as a way to reduce the physical size of the memory sub-system on a single board computer. The basic idea is to stack two BGA devices one on top of the other as shown above. PoP Memory has Several Advantages Including: More reliable manufacture because the memory sub-system can be assembled separately from the final system. Higher memory cycle speeds due to shorter connection lengths. Small size This type of memory is used in handsets and other types of portable devices and is also making it’s way into mid-level products as well. Disadvantages Include: BGA assemble issues, can only re-ball the part a limited number of times then it must be scrapped. So, for example, if the RAM portion fails, the FLASH could be de-soldered and re-soldered to a working RAM module, but only a limited number of times. Test issues – BGA packages do not allow access to device pins once the device is soldered down. In the case of a PoP module, since the top module is soldered to the bottom, there is no way to access the pins. Typically JTAG boundary-Scan tools can be used to test in this configuration. PoP: Package-on-Package

Galaxy Note Teardown Flip-chip DRAM on App. Processor K3PE7E700B-XXC1 low power 1GB DDR2 S5PC210 Exynos 4210 : ARM Cortex A9 (Dual-core) 1.4GHz with Mali-400 MP GPU

STMicroelectronics’ Gyroscope Galaxy Note Teardown LCD Driver Yamaha Audio Codec Audio Processor STMicroelectronics’ Gyroscope

Components of Embedded Systems Software - System software Operating systems Many times, a multitasking (multithreaded) OS is required, as embedded applications become complicated Networking, GUI, Audio, Video CPU is context-switched to process multiple jobs Operating system footprint should be small enough to fit into memory of an embedded system In the past and even now, real-time operating systems (RTOS) such as VxWorks and uC/OS-II have been used because they are light-weighted in terms of memory requirement Nowadays, heavy-weighted OSs such as iOS, Android, Windows Mobile, and embedded Linux (uClinux) are used, as embedded processors support computing power and advanced capabilities such as MMU (Memory Management Unit) Device drivers for I/O devices

Components of Embedded Systems (Cont) Software (cont.) - Application software Run on top of operating system Execute tasks that users wish to perform Web surfing, Social Network Service, Audio, Video playback

Hard real-time systems Real-time operating system (RTOS): Multitasking operating system for real-time applications RTOS is valued for how quickly and/or predictably respond to a particular event Hard real-time systems are required to complete a critical task within a guaranteed amount of time Soft real-time systems are less restrictive Implementing real-time system requires a careful design of scheduler System must have the priority-based scheduling Real-time processes must have the highest priority Priority inheritance (next slide) Solve the priority inversion problem Process dispatch latency must be small Hard real-time systems Hard real-time system examples: pacemaker and car control system

Priority Inversion Problem Pathfinder mission on Mars in 1997 Used VxWorks, an RTOS kernel, from WindRiver Software problems caused the total system resets of the Pathfinder spacecraft in mission Watchdog timer goes off, informing that something has gone dramatically wrong and initiating the system reset

Priority Inversion Problem VxWorks provides preemptive priority scheduling of threads Tasks on the Pathfinder spacecraft were executed as threads with priorities that were assigned in the usual manner reflecting the relative urgency of these tasks. Task 1 tries to get the semaphore Task 1 gets the semaphore and execute Task 1 preempts Task3 Priority Inversion Task 1 (highest priority) Task 2 (medium priority) Task 2 preempts task 3 Task 3 (lowest priority) Task 3 is resumed Time Task 3 gets semaphore Task 3 is resumed Task 3 releases the semaphore

Priority Inheritance A lower priority process could be accessing a critical section (a shared resource) that the higher priority process needs The process with a lower priority inherits the higher priority until they are done with the resource When they are finished, its priority reverts to its original value Task 1 tries to get the semaphore (Priority of Task 3 is raised to Task 1’s) Task 1 preempts Task3 Task 1 completes Priority Inversion Task 1 (highest priority) Task 2 (medium priority) Task 3 (lowest priority) Time Task 3 gets semaphore Task 3 is resumed with the highest priority Task 3 releases the semaphore

Operating Systems for Embedded Systems RTOSs pSOS VxWorks VRTX (Versatile Real-Time Executive) uC/OS-II Palm OS & Symbian OS(source: Wikipedia) Palm OS: Embedded operating system initially developed by U.S. Robotics-owned Palm Computing, Inc. for personal digital assistants (PDAs) in 1996 Symbian OS: Proprietary operating system designed for mobile devices by Symbian Ltd. A descendant of Psion's EPOC and runs exclusively on ARM processors Android (http://www.android.com/) Open Handset Alliance Project Based on modified version of Linux 2.6 kernel Currently supporting ARM, MIPS, and x86

Operating Systems for Embedded Systems uClinux (source: Wikipedia) - as of 2009 The use of a Linux operating system in embedded computer systems According to survey conducted by Venture Development Corporation, Linux was used by 18% of embedded engineers Embedded versions of Linux are designed for devices with relatively limited resources, such as cell phones and set-top boxes Due to concerns such as cost and size, embedded devices usually have much less RAM and secondary storage than desktop computers, and are likely to use flash memory instead of a hard drive Since embedded devices are used for specific purposes rather than general purposes, developers optimize their embedded Linux distributions to target specific hardware configurations and usage situations These optimizations can include reducing the number of device drivers and software applications, and modifying the Linux kernel to be a real-time operating system Instead of a full suite of desktop software applications, embedded Linux systems often use a small set of free software utilities such as busybox, and replace the glibc C standard library with a more compact alternative such as dietlibc, uClibc, or Newlib.

Embedded System Design Flow Planning & Architect (modeling & simulation) Hardware Design with CAD tools ASIC/SoC design ASIC/SoC chip Final product Hardware debugging & Software development System prototype board ASIC: Application-Specific Integrated Circuit SoC: System-on-Chip

A General-Purpose Computer System (till 2008) CPU Main Memory (DDR2) FSB (Front-Side Bus) North Bridge Graphics card DMI (Direct Media I/F) Peripheral devices South Bridge Hard disk USB PCIe card But, don’t forget the big picture!

Past, Present and More… Core i7 (Ivy Bridge) – based Systems Core 2 Duo – based Systems CPU North Bridge South Bridge Main Memory (DDR2) FSB (Front-Side Bus) DMI (Direct Media I/F) FDI or Flexible Display Interface is an interconnect created by Intel in order to allow the communication of the HD Graphics integrated GPU found on supported CPUs with the PCH southbridge where display connectors are attached. It provides a path between an Intel processor and an Intel southbridge on a computer motherboard which carries display data from the graphics controller (North Display) of the Intel processor package to the display connectors attached at some PCH (South Display) versions. Keep in mind that CPU and computer systems are evolving at a fast pace! FDI: Flexible Display Interface SPI: Serial Peripheral Interface SMBus: System Management Bus

x86 History (as of 2008)

x86 History (Cont.) 2009 2011 2012 4-bit 8-bit 16-bit 32-bit (i386) 64-bit (x86_64) 2009 2011 1st Gen. Core i7 (Nehalem) 2nd Gen. Core i7 (Sandy Bridge 2012 3rd Gen. Core i7 (Ivy Bridge)

x86? What is x86? Generic term referring to processors from Intel, AMD and VIA Derived from the model numbers of the first few generations of processors: 8086, 80286, 80386, 80486  x86 Now it generally refers to processors from Intel, AMD, and VIA x86-16: 16-bit processor x86-32 (aka IA32): 32-bit processor * IA: Intel Architecture x86-64: 64-bit processor Intel takes about 80% of the PC market and AMD takes about 20% Apple also have been introducing Intel-based Mac from Nov. 2006 * aka: also known as

Chipset We call North and South Bridges as Chipset Chipset has many PCIe devices inside North Bridge Memory controller PCI express ports to connect Graphics card http://www.intel.com/Assets/PDF/datasheet/316966.pdf South Bridge HDD (Hard-disk) controller USB controller Various peripherals connected Keyboard, mouse, timer etc PCI express ports http://www.intel.com/Assets/PDF/datasheet/316972.pdf Note that the landscape is being changed! For example, memory controller is integrated into CPU

PCI, PCI Express Devices PCI (Peripheral Component Interconnect) Computer bus connecting all the peripheral devices to the computer motherboard PCIe (PCI Express) Replaced PCI in 2004 Point-to-point connection PCI express slot x16 PCI express slots PCI slot http://www.pcisig.com/specifications/pciexpress/

An Old GP Computer System Example

PCI Express Slots in GP Systems

GP Computer System in terms of PCIe North Bridge South Bridge

Software Stack Applications Operating System BIOS Computer Hardware (MS-office, Google Earth…) API (Application Program I/F) Operating System (Linux, Vista, Mac OS …) BIOS provides common I/Fs BIOS (AMI, Phoenix Technologies …) Computer Hardware (CPU, Chipset, PCIe cards ...)

How the GP Computer System Works? x86-based system starts to execute from the reset address 0xFFFF_FFF0 The first instruction is “jmp xxx” off from BIOS ROM BIOS (Basic Input/Output System) Detect and initialize all the devices (including PCI devices via PCI enumeration) on the system Provide common interfaces to OS Hand over the control to OS OS Manage the system resources including main memory Control and coordinate the use of the hardware among various application programs for the various users Provide APIs for system and application programming

So… What? How is it different from embedded systems? General-purpose computer systems provide programmability to end-users You can do any kinds of programming on your PC C, C++, C#, Java etc General-purpose systems should provide backward compatibility A new system should be able to run legacy software, which could be in the form of binaries with no source codes written 30 years ago So, general purpose computer system becomes messy and complicated, still containing all legacy hardware functionalities

x86 Operation Modes Real Mode (= real address mode) Protected Mode Programming environment of the 8086 processor 8086 is a 16-bit processor from Intel Protected Mode Native state of the 32-bit Intel processor For example, Windows is running in protected mode if 32-bit Windows is installed on your PC 32-bit mode IA-32e mode (IA-32 Extended Mode) There are 2 sub modes Compatibility mode 64-bit mode

Registers in 8086 Registers inside the 8086 Registers in x86-32 16-bit segment registers CS, DS, SS, ES General-purpose registers all 16-bits AX, BX, CX, DX, SP, BP, SI, DI Registers in x86-32

Real Mode Addressing In real mode (8086), general purpose registers are all 16-bit wide Real model Segment registers specify the base address of each segment Segment registers CS: Code Segment -> used to store instructions DS: Data Segment -> used to store data SS: Stack Segment -> stack ES: Extra Segment -> could be used to store more data Addressing method Segment << 4 + offset = physical address Example: mov ax, 2000h mov ds, ax  Data segment starts from 20000h (2000h << 4)

Data Segment in Real Mode Memory addressing in real mode (8086) 0xFFFFF Main Memory (1MB) mov ax, 2000h mov ds, ax mov al, [100h] 20100h offset 100h DS 2000h 20000h = 2000h << 4 0x0

A20M 8088/8086 allows only 1MB memory access since they have only 20-bit physical address lines 220 = 1MB Memory is accessed with segment:offset in 8086/8088 (still the same though) What if CS=0xFFFF, IP=0x0020? CS << 4 + IP = 0x100010 But, we have only 20 address lines. So, 8088 ends up accessing 0x00010 ignoring the “1” in A21 Some (weird?) programmers took advantage of this mechanism

A20M (Cont) How about now? Your Core 2 Duo has 48-bit physical address lines What happens if there is no protection in the previous case Processor will access 0x100010, breaking the legacy code So, x86 provides a mechanism called A20M (A20 Mask) to make it compatible with the old generations

A20M (Cont)

Another Example Protected mode addressing (32-bit) As application programs become larger, 1MB main memory is too small Intel introduced protected mode to address a larger memory (up to 4GB) But, Intel still wants to use 16-bit segment registers for the backward compatability How to access a 4GB space with a 16-bit register?

Protected Mode Addressing TI = 0 TI = 1 Hardware Inside the CPU (Registers) Main memory Index Segment Selector TI RPL 15 3 2 1 0 Visible to software GDT LDT Segment Descriptor Segment Descriptor Segment Descriptor Segment Descriptor Invisible to software TI: Table Indicator RPL: Requested Privilege Level Segment Descriptor Segment Descriptor Segment Descriptor Segment Descriptor Base Access info 31 0 19 0 Limit Segment Descriptor Segment Descriptor TI: Table Indicator RPL: Requested Privilege Level

Segment Descriptor Format Software (OS) creates descriptor tables (GDT, LDT)

Address Translation in Protected Mode

One More Example 8259 Interrupt Controller Still in South Bridge IR0 CPU North Bridge South Bridge Main Memory (DDR) FSB (Front-Side Bus) DMI (Direct Media I/F) IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7 INTR INTA 82C59A (Master) (Slave) CPU (8086) Still in South Bridge

Backup Slides

Core i7-based Systems Core i7 860 (Lynnfield) – based system Core i7 920 (Bloomfield) – based system

Present and More… Core i7– based Systems Core 2 Duo – based Systems Main Memory (DDR2) Main Memory (DDR3) CPU CPU FSB (Front-Side Bus) Quickpath (Intel) or Hypertransport (AMD) North Bridge North Bridge South Bridge South Bridge DMI (Direct Media I/F) DMI (Direct Media I/F) Keep in mind that CPU and computer systems are evolving at a fast pace