Real-Time Systems Development with RTEMS and Multicore Processors

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

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.

Author(s): Gedare Bloom, Joel Sherrill, Tingting Hu, Ivan Cibrario Bertolotti
Series: Embedded Systems
Edition: 1
Publisher: CRC Press
Year: 2022

Language: English
Tags: RTEMS, multicore, real-time

Preface
The Authors
Chapter 1: Introduction
PART 1: Operating System Basics
Chapter 2: Cross-Compilation Toolchain
2.1 From Source Code to the Executable Image
2.1.1. The Compiler Driver
2.1.2 The Preprocessor
2.1.3 The Linker
2.2 Linker Scripts
2.2.1 Input and Output Sequences
2.2.2 Memory Layout
2.2.3 Linker Section
2.2.4 Section and Memory Maiming
2.3 GNU Make and Makefiles
2.3.1 Explicit Rules
2.3.2 Variables
2.3.3 Pattern Rules and Automatic Variables
2.3.4 Directives and Functions
2.4 Basic Description of RTEMS and its Configuration System
2.4.1 RTEMS Compile-Time Configuration
2.4.2 Applications Compile-Time Configuration
2.5 Summary
Chapter 3: Concurrent Programming and Scheduling Algorithms
3.1 Foundations of Concurrent Programming
3.1.1 From Interrupt Handling to Multiprogramming
3.1.2 Cooperating Sequential Processes
3.2 Scheduling Policies Mechanisms and Algorithms
3.2.1 Task Interleaviug and Timing
3.2.2 Task Control Block and Task State Diagain
3.2.3 Real-Time Scheduling Algorithms
3.3 Summary
Chapter 4: Scheduling Analysis and Interrupt Handling
4.1 Basics of Real-Time Scheduling Analysis
4.1.1 Utilization-Based Schedulability Tests
4.1.2 Response Time Analysis
4.1.3 Task Interactions and Self-Suspension
4.2 Practical Considerations on Interrupt Handling
4.2.1 Exception Handling in The Cortex-M Processor
4.2.2 Exception Priorities and Entry/Exit Sequence
4.2.3 RTEMS Context Switch and Exception Handling
4.2.4 Interrupts in Schedulability Analysis
4.3 Summary
PART II Task Management and Timekeeping
Chapter 5: Task Management and Timekeeping, Classic API
5.1 Task Management Basics
5.2 Scheduler Manager and Single-Core Scheduling Algorithms
5.3 RTEMS Classic and POSIX API
5.4 Task Management
5.5 The Rate Monotonic Manager
5.6 Timekeeping: Clocks and Timers
5.7 Preemption and Interrupt Management
5.8 Summary
Chapter 6: Task Management and Timekeeping, POSIX API
6 1 Attribute Objects
6.2 Thread Creation and Termination
6.3 Thread Scheduling
6.4 Forced Thread Termination (Cancellation)
6.5 Signal Handling
6.6 Timekeeping
6.7 Summary
PART III: Inter-Task Synchronization and Communication
Chapter 7: Inter-Task Synchronization and Communication (IPC) Kiser] On Shared Memory
7.1 Race Conditions and Mutual Exclusion
7.1.1 An Example of Race Condition
7.1.2 Critical Regions
7.1.3 Lock-Based Mutual Exclusion
7.1.4 Correctness Conditions
7.2 Semaphores
7.2.1 Definition and Properties
7.2.2 Mutual Exclusion Semaphores
7.2.3 Synchronization Semaphores
7.2.4 Producers and Consumers
7.3 Monitors
7.3.1 Definition and Properties
7.3.2 Condition Variables
7.4 RTEMS API for Shared-Memory IPC
7.4.1 Classic API
7.4.2 POSIX API
7.5 Barriers
7.5.1 General Definition
7.5.2 Classic API
7.5.3 POSIX API
7.6 Events
7.7 Summary
Chapter 8: IPC Task Execution and Scheduling
8.1 Priority Inversion
8.1.1 Mutual Exclusion and Priority Inversion
8.1.2 The Priority Inheritance Protocol
8.1.3 The Priority Ceiling Protocol
8.2 Deadlock
8.2.1 Definition and Examples of Deadlock
8.2.2 Deadlock in the Producers-Consumers Problems
8.2.3 Deadlock Prevention
8.2.4 Deadlock Avoidance
8.2.5 Deadlock Detection and Recovery
8.3 Summary
Chapter 9: IPC Rased on Message Passing
9.1 Unified Synchronization and Data Exchange
9.2 Message Passing Synchronization Models
9.3 Direct and Indirect Naming
9.4 RTEMS API for Message Passing
9.4.1 Classic API
9.4.2 POSIX API
9.3 Summary
PART IV Network Communication
Chapter 10: Network Communication in RTEMS
10.1 Internal Structure of the RTEMS Networking Code
10.2 Protocol Stack Organisation
10.3 Main Data Structures
10.4 RTEMS Port and Adaptation Layer
10.4.1 Mutual Exclusion and Sleep/Wakeup
10.4.2 Software Interrupts and Network Daemon
10.4.3 Timeout Emulation
10.4.4 Device Driver Organization
10.5 Summary
Chapter 11: POSIX Sockets API
11.1 Main Features
11 2 Communication Endpoint Management
11.3 Local Socket Address
11.4 Connection Establishment
11.5 Connectionless Sockets
11.6 Data Transfer
11.7 Socket Options
11.8 Non-Blocking I/O and Synchronous I/O Multiplexing
11.9 Summary
PART V Multicores in Real-Time Embedded Systems
Chapter 12: Multicores in Embedded Systems
12.1 Motivation
12.2 Multiprocessors and Multicores
12.2.1 Basics of Multicore Architectures
12.2.2 Memory Consistency Models
12.2.3 Cache Coherency
12.2.4 Practical Implementation on ARM Processors
12.2.5 Compiler-Level Instruction Reordering
12.3 Software Challenges Introduced by Multicores
12.3.1 Loss of the Critical Instant Theorem
12.3.2 Dhaffs Effect
12.3.3 Implicit Mutual Exclusion 12.4Sunryna
Chapter 13: Multicore Concurrency: Issues and Solutions
13.1 Classes of Multicore Scheduling Algorithms
13.2 Multicore Scheduling Algorithms in RTEMS
13.3 Schedulers Configuration
13.4 Multicore Synchronization Devices
13.4.1 Multiprocessor Resource Sharing Protocol
13.4.2 O(m) Independence-Preserving Protocol
13.5 Lock-Free and Wait-Free Communication
13.5.1 Basic Principles and Definitions
13.5.2 Lock-Free Multi-Word Counter Read
13.5.3 Four-Slot Asynchronous Communication
13.5.4 Universal Construction of Lock-Free Objts
13.6 5pinlocks and Interrupt Handling Synchronization
13.7 Summary
References
Index