Real-Time Systems Development with RTEMS and Multicore Processors
- 518 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Real-Time Systems Development with RTEMS and Multicore Processors
About This Book
The proliferation of multicore processors in the embedded market for Internet-of-Things (IoT) and Cyber-Physical Systems (CPS) makes developing real-time embedded applications increasingly difficult. What is the underlying theory that makes multicore real-time possible? How does theory influence application design? When is a real-time operating system (RTOS) useful? What RTOS features do applications need? How does a mature RTOS help manage the complexity of multicore hardware?
Real-Time Systems Development with RTEMS and Multicore Processors answers these questions and more with exemplar Real-Time Executive for Multiprocessor Systems (RTEMS) RTOS to provide concrete advice and examples for constructing useful, feature-rich applications. RTEMS is free, open-source software that supports multi-processor systems for over a dozen CPU architectures and over 150 specific system boards in applications spanning the range of IoT and CPS domains such as satellites, particle accelerators, robots, racing motorcycles, building controls, medical devices, and more.
The focus of this book is on enabling real-time embedded software engineering while providing sufficient theoretical foundations and hardware background to understand the rationale for key decisions in RTOS and application design and implementation. The topics covered in this book include:
-
- Cross-compilation for embedded systems development
-
- Concurrent programming models used in real-time embedded software
-
- Real-time scheduling theory and algorithms used in wide practice
-
- Usage and comparison of two application programmer interfaces (APIs) in real-time embedded software: POSIX and the RTEMS Classic APIs
-
- Design and implementation in RTEMS of commonly found RTOS features for schedulers, task management, time-keeping, inter-task synchronization, inter-task communication, and networking
-
- The challenges introduced by multicore hardware, advances in multicore real-time theory, and software engineering multicore real-time systems with RTEMS
All the authors of this book are experts in the academic field of real-time embedded systems. Two of the authors are primary open-source maintainers of the RTEMS software project.
Frequently asked questions
Information
1
Introduction
- Chapter 2, Cross-Compilation Toolchain. This chapter first describes the main components of a GNU-based1 cross-compilation toolchain, focusing in particular on the linker command language and on GNU make, a tool commonly used to coordinate and automate the software build process. The second part of the chapter discusses the compile-time configuration of the RTEMS operating system.
- Chapter 3, Concurrent Programming and Scheduling Algorithms. The first main goal of this chapter is to lay out the theoretical foundations of concurrent programming. The discussion covers the all-important concept of process, or task, and how task state is represented within an operating system as it evolves over time. The second part of the chapter introduces the reader to real-time scheduling methods and techniques on single-processor systems, while the discussion of scheduling algorithms suitable for multicore systems is left to Part V.
- Chapter 4, Scheduling Analysis and Interrupt Handling. The main topic of this chapter is scheduling analysis, a set of mathematical tools to predict the worst-case timing behavior of a real-time system. The discussion starts from a high-level view of the system, abstracted as a set of tasks, and then shows how interrupt handling fits in the scheduling analysis framework. A set of practical considerations on interrupt handling, using a popular microprocessor architecture as a reference, concludes the chapter and helps illustrate how RTEMS implements some key activities, like context switch.
- Chapter 5, Task Management and Timekeeping, Classic API. This chapter is devoted to the RTEMS scheduling algorithms for single-core systems and the facilities that RTEMS provides to manipulate tasks and account for the passage of time through its Classic API. It also contains a comparison with the POSIX standard API and a description of some lower-level aspects of interrupt handling on single-core systems made accessible by the RTEMS Interrupt Manager and often essential in embedded systems.
- Chapter 6, Task Management and Timekeeping, POSIX API. The chapter contains an extensive description of the POSIX API for task management and timekeeping. Special attention is given to the cancellation and signalling mechanisms, which do not have a direct counterpart in the Classic API.
- Chapter 7, Inter-Task Synchronization and Communication (IPC) Based on Shared Memory. This chapter describes the fundamental concepts of race condition, critical region, and lock-based mutual exclusion. It introduces the reader to the classic inter-task synchronization and communication methods based on shared memory, namely, semaphores and monitors. Two more specialized synchronization devices, barriers and events, are also included in the discussion due to their considerable practical interest.
- Chapter 8, IPC, Task Execution, and Scheduling. This chapter is devoted to priority inversion and deadlock, two very important issues related to lock-based synchronization and communication, which may impair the timings of any real-time system if not appropriately solved. To this aim, the chapter discusses several suitable design-time and runtime methods and techniques.
- Chapter 9, IPC Based on Message Passing. This chapter introduces readers to message passing, an IPC mechanism that does not rely on shared memory for data transfer, thus paving the way to a unified IPC technique that is also suitable for distributed systems in which multiple independent nodes are connected by a communication network. As in the rest of the book, theoretical concepts are presented together with their RTEMS implementation.
- Chapter 10, Network Communication in RTEMS. This chapter describes the internal structure of the RTEMS networking code and highlights the most important aspects of operating system / protocol stack integration, such as synchronization and the device driver interface.
- Chapter 11, POSIX Sockets API. This chapter complements the previous one and discusses in detail how users can access the RTEMS networking code in an operating system and protocol-independent way, by means of the standard POSIX Sockets API.
- Chapter 12, Multicores in Embedded Systems. The chapter outlines the motivation behind the widespread diffusion of multicore processors for embedded systems and provides an overview of their architecture. Then, it summarizes the challenges introduced by multicores in software development for embedded systems, focusing on the areas of task scheduling, schedulability algorithms and analysis, and proper inter-task communication and synchronization.
- Chapter 13, Multicore Concurrency: Issues and Solutions. The chapter summarizes the most common scheduling algorithms and synchronization devices for real-time multicore systems and illustrates how they are supported in RTEMS. The second part of the chapter provides information about lock-free and wait-free synchronization, which is often a valid alternative to lock-based synchronization described in Part III, as well as the use of spinlocks for task/interrupt handler synchronization.
Part I
Operating System Basics
2
Cross-Compilation Toolchain
CONTENTS
2.1 FROM SOURCE CODE TO THE EXECUTABLE IMAGE
- The GCC Compiler. It translates a C/C++ source file, which in turn may include other headers or source files, and produces an object module in binary format. This generally involves a multi-step code generation process, which is better detailed in Section 2.1.1. Although it is generally called “the compiler”, the
gcc
program is actually a compiler driver, able to perform different actions by invoking other toolchain components appropriately, depending on the input file type usually derived from its filename extension. The compiler driver behavior can be customized by means of command-line options. Depending on the target architecture, different options may be provided, to drive the compilation for that specific architecture. For instance, the-march
o...
Table of contents
- Cover
- Half Title
- Series Page
- Title Page
- Copyright Page
- Contents
- Preface
- The Authors
- Chapter 1 Introduction
- Part I Operating System Basics
- Part II Task Management and Timekeeping
- Part III Inter-Task Synchronization and Communication
- Part IV Network Communication
- Part V Multicores in Real-Time Embedded Systems
- References
- Index