Lecture 1. What is Embedded System? Prof. Taeweon Suh Computer Science & Engineering Korea University COMP427 Embedded Systems.

Slides:



Advertisements
Similar presentations
Embedded System Lab. What is an embedded systems? An embedded system is a computer system designed for specific control functions within a larger system,
Advertisements

1 A Real Problem  What if you wanted to run a program that needs more memory than you have?
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Operating System Support Focus on Architecture
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
Operating Systems. What is an Operating System? A layer of software between users/applications and the hardware. The first program loaded onto a computer.
Memory Management 2010.
Chapter 13 Embedded Systems
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Chapter 11 Operating Systems
Computer Organization and Architecture
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating 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.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Virtual Memory By: Dinouje Fahih. Definition of Virtual Memory Virtual memory is a concept that, allows a computer and its operating system, to use a.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Lecture 1. Embedded Systems vs General-Purpose Systems
Week 6 Operating Systems.
Lecture 1. Embedded Systems vs General-Purpose Systems
Chapter 3.1: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.
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Lecture 1. Embedded Systems vs General- Purpose Systems Prof. Taeweon Suh Computer Science Education Korea University COM609 Topics in Embedded Systems.
Computing Hardware Starter.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
Lecture 1. x86 General-purpose vs Embedded Systems
Introduction to Embedded Software Development School of software Engineering Introduction to Windows CE.
1 Previous lecture review n Out of basic scheduling techniques none is a clear winner: u FCFS - simple but unfair u RR - more overhead than FCFS may not.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Chapter 8: Operating Systems and Utility Programs Catherine Gifford Dan Falgares.
Processes and OS basics. RHS – SOC 2 OS Basics An Operating System (OS) is essentially an abstraction of a computer As a user or programmer, I do not.
1.1 Operating System Concepts Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered.
IT253: Computer Organization
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Scott Ferguson Section 1
© GCSE Computing Computing Hardware Starter. Creating a spreadsheet to demonstrate the size of memory. 1 byte = 1 character or about 1 pixel of information.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
CS4315A. Berrached:CMS:UHD1 Introduction to Operating Systems Chapter 1.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
Course 03 Basic Concepts assist. eng. Jánó Rajmond, PhD
Lecture 1. What is Embedded System?
CT101: Computing Systems Introduction to Operating Systems.
1 OPERATING SYSTEMS. 2 CONTENTS 1.What is an Operating System? 2.OS Functions 3.OS Services 4.Structure of OS 5.Evolution of OS.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
REAL-TIME OPERATING SYSTEMS
Chapter 1: Introduction
Memory COMPUTER ARCHITECTURE
Chapter 1: Introduction
Chapter 1: Introduction
Unit OS9: Real-Time and Embedded Systems
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Chapter 1: Introduction
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Subject Name: Operating System Concepts Subject Number:
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
COMP755 Advanced Operating Systems
Cache writes and examples
Chapter 1: Introduction
Presentation transcript:

Lecture 1. What is Embedded System? Prof. Taeweon Suh Computer Science & Engineering Korea University COMP427 Embedded Systems

Korea Univ Embedded Systems Embedded System is a special-purpose computer system designed to perform one or a few dedicated functions -- Wikipedia  In general, it does not provide programmability to users, as opposed to general purpose computer systems like PC  Embedded systems are virtually everywhere in your daily life 2

Korea Univ Embedded Systems (Cont) 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 3

Korea Univ 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 4

Korea Univ 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 5

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

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

Korea Univ 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 8

Korea Univ 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 9

Korea Univ 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 10 Hard real-time systems

Korea Univ 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 11

Korea Univ 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. 12 Task 3 (lowest priority) Task 2 (medium priority) Task 1 (highest priority) Time Task 3 gets semaphore Task 1 preempts Task3 Task 1 tries to get the semaphore Task 3 is resumed Task 2 preempts task 3 Task 3 is resumed Task 3 releases the semaphore Task 1 gets the semaphore and execute Priority Inversion

Korea Univ 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 13 Task 3 (lowest priority) Task 2 (medium priority) Task 1 (highest priority) Time Task 3 gets semaphore Task 1 preempts Task3 Task 1 tries to get the semaphore (Priority of Task 3 is raised to Task 1’s) Task 3 is resumed with the highest priority Task 1 completes Priority Inversion Task 3 releases the semaphore

Korea Univ 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 (  Open Handset Alliance Project  Based on modified version of Linux 2.6 kernel  Currently supporting ARM, MIPS, and x86 14

Korea Univ 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. 15

Korea Univ FAQ: Linux in Embedded Systems? Is Linux too large?  Linux is highly modular and has an excellent component selection mechanism Based on your system configuration, you can selectively choose software components  How about memory requirement? A minimal working embedded Linux system with networking and file system support needs around 4MB of SDRAM and 2MB of flash Is Linux real-time enough?  A lot of work going on in the embedded Linux to enable real-time Enhancements are in the form of a preemptive kernel or real- time-capable scheduler 16

Korea Univ uClinux A port of Linux to systems without a Memory Management Unit (MMU)  BTW, what’s MMU? Let’s stop here to review MMU (Memory Management Unit)  MMU is an essential hardware component to support and implement virtual memory  MMU provides a fast translation from virtual address to physical address Otherwise, the translation from virtual address to physical address will slow down the execution of your applications a lot 17

Korea Univ Motivation of Virtual Memory Virtual memory (VM) was invented to relieve programmers from burdens 1.VM allows efficient and safe sharing of main memory among multiple programs Consider a collection of programs running all at once on a computer We don’t want to know which programs will share main memory with other programs when we compile them In fact, the programs sharing main memory change dynamically while the programs are running Because of this dynamic interaction, we would like to compile each program into its own address space (virtual address space) VM (implemented in Operating System) dynamically manages the translation of the program’s address space (virtual address space) to the physical address space 2.VM provides the ability to easily run programs larger than the size of physical memory In old days, if a program is too large for memory, it was the programmers’ responsibility to make it fit Programmers divided programs into pieces and then load and unload pieces into main memory under user’s program control 18

Korea Univ Virtual Memory Virtual memory is a technique provided by operating systems such as Windows and Linux Virtual memory uses main memory as a “cache” for secondary storage Virtual memory automatically manages the 2 levels of memory hierarchy: main memory and secondary storage (HDD) Virtual space is split into fixed-sized blocks, which are called pages (typically 4KB) Load only required pages for execution to physical memory Operating systems create page tables, which contain the translation information from virtual page to physical page 19

Korea Univ Memory Subsystem in x86 MMU translates from virtual address to physical address  Operating system creates page tables  TLB (Translation Lookaside Buffer) inside MMU caches recently used page table entries 20 Core 2 Duo E6600 Main Memory (2GB DDR2) CPU core MMU Virtual address Virtual Space Physical address L1 Cache (32KB) L2 Cache (4MB) Hard Disk (320GB) TLB

Korea Univ Visualizing Virtual Memory 21 CPU core MMU Virtual (linear) address Hard disk Virtual memory Space Physical address CPU Windows XP 0 MS Word … 0x4F 1 9 0x xF … 1 3 Hello world Main Memory

Korea Univ uClinux It is hard to support real-time property with virtual memory  Paging in and out takes a huge amount of time BTW, embedded systems generally do not have hard disk though Instead, flash memory is used many times 22

Korea Univ uClinux uClinux has been ported to many microcontrollers  ARM7TDMI (ARM)  Dragonball, ColdFire, 68K Derivatives, QUICC (Motorola)  Blackfin (ADI)  i960 (Intel)  Microblaze (Xilinx)  V850E (NEC) I myself don’t know much about uClinux  I’d like you guys to dig into the source code, hack it, and join the uClinux community! Anyway, we are going to use uClinux for Labs 23