You are previewing Real-Time Embedded Systems.
O'Reilly logo
Real-Time Embedded Systems

Book Description

This book integrates new ideas and topics from real time systems, embedded systems, and software engineering to give a complete picture of the whole process of developing software for real-time embedded applications. You will not only gain a thorough understanding of concepts related to microprocessors, interrupts, and system boot process, appreciating the importance of real-time modeling and scheduling, but you will also learn software engineering practices such as model documentation, model analysis, design patterns, and standard conformance.

This book is split into four parts to help you learn the key concept of embedded systems; Part one introduces the development process, and includes two chapters on microprocessors and interrupts---fundamental topics for software engineers; Part two is dedicated to modeling techniques for real-time systems; Part three looks at the design of software architectures and Part four covers software implementations, with a focus on POSIX-compliant operating systems.

With this book you will learn:

  • The pros and cons of different architectures for embedded systems
  • POSIX real-time extensions, and how to develop POSIX-compliant real time applications
  • How to use real-time UML to document system designs with timing constraints
  • The challenges and concepts related to cross-development
  • Multitasking design and inter-task communication techniques (shared memory objects, message queues, pipes, signals)
  • How to use kernel objects (e.g. Semaphores, Mutex, Condition variables) to address resource sharing issues in RTOS applications
  • The philosophy underpinning the notion of "resource manager" and how to implement a virtual file system using a resource manager
  • The key principles of real-time scheduling and several key algorithms


  • Coverage of the latest UML standard (UML 2.4)
  • Over 20 design patterns which represent the best practices for reuse in a wide range of real-time embedded systems
  • Example codes which have been tested in QNX---a real-time operating system widely adopted in industry

Table of Contents

  1. Cover image
  2. Title page
  3. Table of Contents
  4. Copyright
  5. Preface
  6. Acknowledgments
  7. Dedication
  8. Acronyms
  9. Part I: Introduction
    1. Chapter 1: Introduction to Embedded and Real-Time Systems
      1. Abstract
      2. 1.1 Embedded Systems
      3. 1.2 Real-Time Systems
      4. 1.3 Case Study: Radar System
      5. Problems
    2. Chapter 2: Cross-Platform Development
      1. Abstract
      2. 2.1 Cross-Platform Development Process
      3. 2.2 Hardware Architecture
      4. 2.3 Software Development
      5. 2.4 Build Target Images
      6. 2.5 Transfer Executable File Object to Target
      7. 2.6 Integrated Testing on Target
      8. 2.7 System Production
      9. Problems
    3. Chapter 3: Microprocessor Primer
      1. Abstract
      2. 3.1 Introduction to Microprocessors
      3. 3.2 Microchip PIC18F8720
      4. 3.3 Intel 8086
      5. 3.4 Intel Pentium
      6. 3.5 ARM926EJ-S
      7. Problems
    4. Chapter 4: Interrupts
      1. Abstract
      2. 4.1 Introduction to Interrupts
      3. 4.2 External Interrupts
      4. 4.3 Software Interrupts
      5. 4.4 Internal Interrupts
      6. 4.5 Design Patterns for ISRs
      7. 4.6 Interrupt Response Time
      8. 4.7 Case Study: x86
      9. 4.8 Case Study: ARM Processor
      10. Problems
    5. Chapter 5: Embedded System Boot Process
      1. Abstract
      2. 5.1 System Bootloader
      3. 5.2 System Boot Process
      4. 5.3 Case Study: AT91SAM9G45 Boot Process
      5. 5.4 Load ELF Objects Embedded Within an OS Image
      6. 5.5 Case Study: Boot Process of QNX-based Embedded Systems
      7. Problems
  10. Part II: Real-Time System Modeling
    1. Chapter 6: Fundamental UML Structural Modeling
      1. Abstract
      2. 6.1 Unified Modeling Language
      3. 6.2 Class Diagram and Class Modeling
      4. 6.3 Class Modeling Principles
      5. 6.4 Object Diagram
      6. 6.5 Package Diagram
      7. Problems
    2. Chapter 7: Architecture Modeling in UML
      1. Abstract
      2. 7.1 Levels of Architectural Abstraction
      3. 7.2 UML Structure Diagram
      4. 7.3 Modeling Components
      5. 7.4 Modeling Subsystems
      6. 7.5 Modeling a Complete System
      7. 7.6 Deployment Diagram
      8. Problems
    3. Chapter 8: Fundamental UML Behavioral Modeling
      1. Abstract
      2. 8.1 Use Case Diagram and Use Case Modeling
      3. 8.2 Sequence Diagram
      4. 8.3 Activity Diagram
      5. Problems
    4. Chapter 9: Modeling Stateful Behaviors in UML
      1. Abstract
      2. 9.1 Basics of a State Machine Diagram
      3. 9.2 Composite States
      4. 9.3 Inheritance of State Behavior
      5. 9.4 Stateful Object Timing Diagrams
      6. 9.5 Example: Modeling Stateful Behavior of a Radar System
      7. Problems
    5. Chapter 10: Real-Time UML: General Resource Modeling
      1. Abstract
      2. 10.1 Real-Time UML Profile
      3. 10.2 Resource Modeling
      4. 10.3 Time Modeling
      5. 10.4 Concurrency Modeling
      6. Problems
    6. Chapter 11: Real-Time UML: Model Analysis
      1. Abstract
      2. 11.1 Elicitation of Timing Constraints
      3. 11.2 RT-UML Profile Schedulability Modeling Subprofile
      4. 11.3 RT-UML Profile Performance Modeling Subprofile
      5. Problems
  11. Part III: Real-Time System Design
    1. Chapter 12: Software Architectures for Real-Time Embedded Systems
      1. Abstract
      2. 12.1 Real-Time Tasks
      3. 12.2 Round-Robin Architecture
      4. 12.3 Round Robin with Interrupts
      5. 12.4 Queue-Based Architecture
      6. Problems
    2. Chapter 13: POSIX and RTOS
      1. Abstract
      2. 13.1 Introduction to POSIX
      3. 13.2 Task Statics and Dynamics
      4. 13.3 Real-Time OSs
      5. 13.4 POSIX Real-Time Scheduling Policies
      6. 13.5 Other Real-Time Scheduling Policies
      7. Problems
    3. Chapter 14: Multitasking
      1. Abstract
      2. 14.1 Introduction to Multitasking
      3. 14.2 Multitask Design
      4. 14.3 Multitask Resource Sharing
      5. 14.4 Addressing Resource Deadlocks
      6. 14.5 Addressing Priority Inversion
      7. Problems
    4. Chapter 15: Real-Time Scheduling: Clock-Driven Approach
      1. Abstract
      2. 15.1 Introduction to Cyclic Scheduling
      3. 15.2 Ad-hoc Clock-Driven Scheduling
      4. 15.3 Frame-Based Scheduling
      5. 15.4 Scheduling Aperiodic Jobs
      6. 15.5 Task Splitting
      7. Problems
    5. Chapter 16: Real-Time Scheduling: Rate-Monotonic Approach
      1. Abstract
      2. 16.1 Priority Assignment
      3. 16.2 RMA Principle
      4. 16.3 Rate-Monotonic Analysis
      5. 16.4 Completion-Time Test
      6. 16.5 Period Transformation
      7. 16.6 Generalized Schedulability Analysis
      8. Problems
    6. Chapter 17: Real-Time Scheduling: Sporadic Server
      1. Abstract
      2. 17.1 Sporadic Tasks
      3. 17.2 Sporadic Server
      4. 17.3 A Naive Sporadic Server
      5. 17.4 A Fixed-Priority Sporadic Server
      6. 17.5 A Dynamic-Priority Sporadic Server
      7. Problems
  12. Part IV: Implementation Patterns
    1. Chapter 18: Resource Sharing
      1. Abstract
      2. 18.1 Shared Variables
      3. 18.2 Shared Memory
      4. 18.3 Semaphore
      5. 18.4 Mutex
      6. 18.5 Condition Variable
      7. Problems
    2. Chapter 19: Intertask Communication: Message Queue
      1. Abstract
      2. 19.1 Introduction to Message Queues
      3. 19.2 Message Queue Statics and Dynamics
      4. 19.3 Message Queue Usage Patterns
      5. 19.4 POSIX Functions for Message Queues
      6. 19.5 An Example of Using Message Queues
      7. Problems
    3. Chapter 20: Intertask Communication: Pipe
      1. Abstract
      2. 20.1 Introduction to Pipes
      3. 20.2 Pipe Statics and Dynamics
      4. 20.3 Pipe Usage Patterns
      5. 20.4 POSIX Functions for Pipes
      6. 20.5 An Example of Using Pipes
      7. Problems
    4. Chapter 21: Intertask Communication: Signaling
      1. Abstract
      2. 21.1 Introduction to POSIX Signals
      3. 21.2 Signal Handling
      4. 21.3 Signal Vector Table and Handlers
      5. 21.4 POSIX Signal Functions
      6. 21.5 QNX Implementation of POSIX Signals
      7. 21.6 Spinlocks and Interrupt Events from ISRs
      8. 21.7 QNX Pulses
      9. Problems
    5. Chapter 22: Software Timer Management
      1. Abstract
      2. 22.1 Hardware Timer and Software Timer
      3. 22.2 Software Timer Manager
      4. 22.3 Timing Wheels
      5. 22.4 Hierarchical Timing Wheels
      6. Problems
    6. Chapter 23: QNX Resource Management
      1. Abstract
      2. 23.1 Introduction to QNX Resource Management
      3. 23.2 Resource Manager Architecture
      4. 23.3 Example 1: Calculator as a Resource Manager
      5. 23.4 Example 2: Device Drivers
      6. Problems
  13. References
  14. Index