Embedded Operating System Design October 4, 2012 Doug Kelly.

Slides:



Advertisements
Similar presentations
The eCos real-time operating system an open source tool to create embedded kernels and applications.
Advertisements

Tutorial 3 - Linux Interrupt Handling -
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Computer System Overview
Computer Organization and Architecture
Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Model for Supporting High Integrity and Fault Tolerance Brian Dobbing, Aonix Europe Ltd Chief Technical Consultant.
Computer Systems/Operating Systems - Class 8
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
1 Computer System Overview OS-1 Course AA
1 CSIT431 Introduction to Operating Systems Welcome to CSIT431 Introduction to Operating Systems In this course we learn about the design and structure.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Chapter 1 and 2 Computer System and Operating System Overview
Hardware Support for Operating Systems Sunny Gleason Vivek Uppal COM S 414
Figure 1.1 Interaction between applications and the operating system.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Computer Organization and Architecture
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
What do operating systems do? manage processes manage memory and computer resources provide security features execute user programs make solving user.
1 Computer System Overview Chapter 1 Review of basic hardware concepts.
Exception and Interrupt Handling
Introduction to Embedded Systems
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Cpr E 308 Input/Output Recall: OS must abstract out all the details of specific I/O devices Today –Block and Character Devices –Hardware Issues – Programmed.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Introduction to Embedded Systems Rabie A. Ramadan 6.
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 CS/COE0447 Computer Organization & Assembly Language Chapter 5 part 4 Exceptions.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Chapter 4 Memory Management Virtual Memory.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
1 Threads, SMP, and Microkernels Chapter 4. 2 Process Resource ownership: process includes a virtual address space to hold the process image (fig 3.16)
ARM Cortex-M0 August 23, 2012 Paul Nickelsberg Orchid Technologies Engineering and Consulting, Inc. CORTEX-M0 Structure Discussion.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Lecture 1: Review of Computer Organization
Playstation2 Architecture Architecture Hardware Design.
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Where Testing Fails …. Problem Areas Stack Overflow Race Conditions Deadlock Timing Reentrancy.
Interrupts and Interrupt Handling David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Homework Reading Machine Projects Labs
REAL-TIME OPERATING SYSTEMS
ARM Embedded Systems
Microprocessor Systems Design I
Operating Systems •The kernel is a program that constitutes the central core of a computer operating system. It has complete control over everything that.
Topics Covered What is Real Time Operating System (RTOS)
Timer and Interrupts.
QNX Technology Overview
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.
Process Description and Control
Lecture 4- Threads, SMP, and Microkernels
COMP3221: Microprocessors and Embedded Systems
Chapter 1: Introduction CSS503 Systems Programming
Presentation transcript:

Embedded Operating System Design October 4, 2012 Doug Kelly

Embedded Platforms What’s different? System-on-Chip (SoC) integrates components Storage (MNAND, NOR, SD…) Power requirements/management May have memory management (MMU) May have graphics processor (GPU) May have direct memory access (DMA) More specialized hardware Digital signal processor (DSP) GPS baseband processor Camera/imaging processor

Embedded Platforms - Processors ARM, MIPS, RISC…? ARM is RISC-based, sold as IP “blocks” Core processor Debugging coprocessor GPU block (Mali), or 3 rd -party vendors (SGX, Tegra) Vector Floating Point (VFP) NEON (SIMD processing architecture) Memory management Cache memory 32-bit architecture Three instruction sets (ARM, Thumb, Thumb2)

Embedded Platforms Okay, so what? Floating point is not free. Time-critical tasks need servicing Other devices may be using memory bus May only have physical addressing Storage is slow, cache is limited Engineers need to solve this!

Operating System Design Emebedded OSes exist! Home-grown, open-source or commercial GarminOS WindowsCE (Windows Embedded Compact) VxWorks QNX Linux (RTLinux) eCos Handle scheduling by priority or round-robin WinCE has 256 process priorities (8 for applications) and round-robin scheduling within a priority

Operating System Design - Memory RTOSes handle memory management Some platforms don’t have MMUs, now what? May not be possible to use dynamic memory Safest, most portable option. Relies on static structures within program to use as scratch space Design a malloc() replacement? Need to mark memory in-use, so it isn’t used while defragging memory Pointer to allocated memory may change, so requires careful design

Operating System Design - Scheduling Threads can be used to limit impact of non- critical failures in some applications Priority systems guarantee most critical tasks run when needed Lower priority tasks run when higher tasks are blocked in some form (may be waiting for next event) But… higher priority tasks could be blocked if a lower-priority task holds a resource!

Operating System Design - Scheduling Priority “inversion” temporarily raises priority Allows low-priority tasks to finish faster, unblocking high- priority tasks Control your loops/recursion! Some coding guidelines for embedded systems prohibit recursion, since it can quickly go without bound or exceed stack space. A high priority task stuck in a runaway loop can result in an unresponsive or useless system. Watch for deadlocks! True in any OS, but may be catastrophic in some cases Some RTOSes can detect deadlocks Always reserve resources in the same order

Operating System Design - Interrupts IRQ, FIQ Come in many flavors Hardware External peripherals DMA Timers Special-purpose hardware interrupt Service watchdog timers, handle rescheduling, sometimes communication Software When good software goes bad “Data Abort” – illegal memory access, page faults (if supported) “Pre-fetch Abort” “Undefined Instruction” Division by zero, etc.

Operating System Design - Interrupts ISRs used to handle interrupts ISRs may have limitations imposed by OS, platform, or processor technology Timing constraints Access to memory IRQ may be interrupted Must not block! Handling dependent on the interrupt vector table Defines both exception and IRQ/FIQ handlers Fast and efficient is the key!

Operating System Design - IPC Inter-process communication used to interact with the system at all levels Hardware drivers have no business updating UI state, nor should UI touch hardware Can also be used to process long-running jobs May be simple events, or contain data Who owns the data? Which thread is the event processed on? When is the event processed? Callback functions to return control Boost signals/slots Object-Oriented Callbacks

Debugging JTAG Closest to processor, can access entire memory bus May be useful for saving snapshot of device state for future analysis. Can also load code into RAM and reset registers (but peripherals may not reset!) WinCE: KITL Kernel level transport, has a fair-amount of control Allows developer to see “into” kernel calls WinCE also supports Visual Studio Remote Debugging Linux/Other: GDB Can be implemented on many platforms; gdb has stubs Don’t rule out printf()!

Doug Kelly Software Engineer Questions?