Real time concepts for embedded systems

317 583 0
Real time concepts for embedded systems

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

This document is created with the unregistered version of CHM2PDF Pilot Real-Time Concepts for Embedded Systems by Qing Li and Carolyn ISBN:1578201241 Yao CMP Books © 2003 (294 pages) This book bridges the gap between higher abstract modeling concepts and the lower-level programming aspects of embedded systems development You gain a solid understanding of real-time embedded systems with detailed examples and industry wisdom Table of Contents Real-Time Concepts for Embedded Systems Foreword Preface Ch apt - Introduction er Ch apt - Basics Of Developing For Embedded Systems er Ch apt - Embedded System Initialization er Ch apt - Introduction To Real-Time Operating Systems er Ch apt - Tasks er Ch apt - Semaphores er Ch apt - Message Queues er Ch apt - Other Kernel Objects er This document is created with the unregistered version of CHM2PDF Pilot Ch apt - Other RTOS Services er Ch apt - Exceptions and Interrupts er 10 Ch apt - Timer and Timer Services er 11 Ch apt - I/O Subsystem er 12 Ch apt - Memory Management er 13 Ch apt - Modularizing An Application For Concurrency er 14 Ch apt - Synchronization And Communication er 15 Ch apt - Common Design Problems er 16 Ap pe ndi - References x A Index List of Figures List of Tables List of Listings This document is created with the unregistered version of CHM2PDF Pilot Back Cover Master the fundamental concepts of real-time embedded system programming and jumpstart your embedded projects with effective design and implementation practices This book bridges the gap between higher abstract modeling concepts and the lower-level programming aspects of embedded systems development You gain a solid understanding of real-time embedded systems with detailed practical examples and industry wisdom on key concepts, design processes, and the available tools and methods Delve into the details of real-time programming so you can develop a working knowledge of the common design patterns and program structures of real-time operating systems (RTOS) The objects and services that are a part of most RTOS kernels are described and real-time system design is explored in detail You learn how to decompose an application into units and how to combine these units with other objects and services to create standard building blocks A rich set of ready-to-use, embedded design building blocks is also supplied to accelerate your development efforts and increase your productivity Experienced developers new to embedded systems and engineering or computer science students will both appreciate the careful balance between theory, illustrations, and practical discussions Hard-won insights and experiences shed new light on application development, common design problems, and solutions in the embedded space Technical managers active in software design reviews of real-time embedded systems will find this a valuable reference to the design and implementation phases About the Authors Qing Li is a senior architect at Wind River Systems, Inc., and the lead architect of the company s embedded IPv6 products Qing holds four patents pending in the embedded kernel and networking protocol design areas His 12+ years in engineering include expertise as a principal engineer designing and developing protocol stacks and embedded applications for the telecommunications and networks arena Qing was one of a four-member Silicon Valley startup that designed and developed proprietary algorithms and applications for embedded biometric devices in the security industry Caroline Yao has more than 15 years of high tech experience ranging from development, project and product management, product marketing, business development, and strategic alliances She is co-inventor of a pending patent and recently served as the director of partner solutions for Wind River Systems, Inc This document is created with the unregistered version of CHM2PDF Pilot Real-Time Concepts for Embedded Systems Qing Li with Caroline Yao Published by CMP Books an imprint of CMP Media LLC Main office: 600 Harrison Street, San Francisco, CA 94107 USA Tel: 415-947-6615; fax: 415-947-6015 Editorial office: 1601 West 23rd Street, Suite 200, Lawrence, KS 66046 USA www.cmpbooks.com email: books@cmp.com Designations used by companies to distinguish their products are often claimed as trademarks In all instances where CMP Books is aware of a trademark claim, the product name appears in initial capital letters, in all capital letters, or in accordance with the vendor's capitalization preference Readers should contact the appropriate companies for more complete information on trademarks and trademark registrations All trade marks and registered trademarks in this book are the property of their respective holders Copyright © 2003 by Wind River Systems, Inc., except where noted otherwise Published by CMP Books, CMP Media LLC All rights reserved Printed in the United States of America No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher The programs in this book are presented for instructional value The programs have been carefully tested, but are not guaranteed for any particular purpose The publisher does not offer any warranties and does not guarantee the accuracy, adequacy, or completeness of any information herein and is not responsible for any errors or omissions The publisher assumes no liability for damages resulting from the use of the information in this book or for any infringement of the intellectual property rights of third parties that would result from the use of this information Technical editors: Robert Ward and Marc Briand Copyeditor: Catherine Janzen Layout design & production: Madeleine Reardon Dimond and Michelle O'Neal Managing editor: Michelle O'Neal Cover art design: Damien Castaneda Distributed to the book trade in the U.S by: Distributed in Canada by: This document is created with the unregistered version of CHM2PDF Pilot Publishers Group West Berkeley, CA 94710 1-800-788-3123 Jaguar Book Group 100 Armstrong Avenue Georgetown, Ontario M6K 3E7 Canada 905-877-4483 For individual orders and for information on special discounts for quantity orders, please contact: CMP Books Distribution Center, 6600 Silacci Way, Gilroy, CA 95020 Tel: 1-800-500-6875 or 408-848-3854; fax: 408-848-5784 email: cmp@rushorder.com; Web: www.cmpbooks.com Library of Congress Cataloging-in-Publication Data Li, Qing, 1971Real-time concepts for embedded systems / Qing Li ; with Caroline Yao p cm Includes bibliographical references and index ISBN 1-57820-124-1 (alk paper) Embedded computer systems Real-time programming I Yao, Caroline II Title Tk7895.E42L494 2003 004'.33-dc21 2003008483 Printed in the United States of America 03 04 05 06 07 To my wife, Huaying, and my daughter, Jane, for their love, understanding, and support To my parents, Dr Y H and Dr N H Li, and my brother, Dr Yang Li, for being the exemplification of academic excellence ISBN: 1-57820-124-1 About the Authors Qing Li is currently a senior architect at Wind River systems and has four patents pending in the embedded kernel and networking protocol design areas His 12+ years in engineering include expertise as a principal engineer designing and developing protocol stacks and embedded applications for the telecommunications and networks arena Qing is the lead architect of Wind River's embedded IPv6 products and is at the forefront of various IPv6 initiatives In the past, Qing owned his own company developing commercial software for the telecommunications industry Additionally, he was one of a four-member Silicon Valley startup that designed and developed proprietary algorithms and applications for embedded biometric devices in the security industry Qing holds a Bachelor of Science degree with Specialization in Computing Science from the University of Alberta in Edmonton, Alberta, Canada Qing has a Masters of Science degree with Distinction in Computer Engineering, with focus in Advanced High Performance Computing from Santa Clara University, Santa Clara, CA, USA Qing is a member of Association for Computing Machinery and a member of IEEE Computer Society This document is created with the unregistered version of CHM2PDF Pilot Caroline Yao has 15+ years in technology and the commercial software arena with six years in the embedded market She has expertise ranging from product development, product management, product marketing, business development, and strategic alliances She is also a co-inventor and co-US patent pending (June 12, 2001) holder for 'System and Method for Providing Cross-Development Application Design Tools and Services Via a Network.' Caroline holds a Bachelor of Arts in Statistics from the University of California Berkeley This document is created with the unregistered version of CHM2PDF Pilot Foreword We live in a world today in which software plays a critical part The most critical soft ware is not running on large systems and PCs Rather, it runs inside the infrastructure and in the devices that we use every day Our transportation, communications, and energy systems won't work if the embedded software contained in our cars, phones, routers and power plants crashes The design of this invisible, embedded software is crucial to all of us Yet, there has been a real shortage of good information as to effective design and implementation practices specific to this very different world Make no mistake, it is indeed different and often more difficult to design embedded software than more traditional programs Time, and the interaction of multiple tasks in real-time, must be managed Seemingly esoteric concepts, such as priority inversion, can become concrete in a hurry when they bring a device to its knees Efficiency-a small memory footprint and the ability to run on lower cost hardware-become key design considerations because they directly affect cost, power usage, size, and battery life Of course, reliability is paramount when so much is at stake-company and product reputations, critical infrastructure functions, and, some times, even lives Mr Li has done a marvelous job of pulling together the relevant information He lays out the issues, the decision and design process, and the available tools and methods The latter part of the book provides valuable insights and practical experiences in understanding application development, common design problems, and solutions The book will be helpful to anyone embarking on an embedded design project, but will be of par ticular help to engineers who are experienced in software development but not yet in real-time and embedded software development It is also a wonderful text or reference volume for academic use The quality of the pervasive, invisible software surrounding us will determine much about the world being created today This book will have a positive effect on that quality and is a welcome addition to the engineering bookshelf Jerry Fiddler Chairman and Co-Founder, Wind River This document is created with the unregistered version of CHM2PDF Pilot Preface Embedded systems are omnipresent and play significant roles in modern-day life Embed ded systems are also diverse and can be found in consumer electronics, such as digital cameras, DVD players and printers; in industrial robots; in advanced avionics, such as missile guidance systems and flight control systems; in medical equipment, such as cardiac arrhythmia monitors and cardiac pacemakers; in automotive designs, such as fuel injection systems and auto-braking systems Embedded systems have significantly improved the way we live today-and will continue to change the way we live tomorrow Programming embedded systems is a special discipline, and demands that embedded sys tems developers have working knowledge of a multitude of technology areas These areas range from low-level hardware devices, compiler technology, and debugging tech niques, to the inner workings of real-time operating systems and multithreaded applica tion design These requirements can be overwhelming to programmers new to the embedded world The learning process can be long and stressful As such, I felt com pelled to share my knowledge and experiences through practical discussions and illustrations in jumpstarting your embedded systems projects Some books use a more traditional approach, focusing solely on programming low-level drivers and software that control the underlying hardware devices Other books provide a high-level abstract approach using object-oriented methodologies and modeling lan guages This book, however, concentrates on bridging the gap between the higher-level abstract modeling concepts and the lower-level fundamental programming aspects of embedded systems development The discussions carried throughout this book are based on years of experience gained from design and implementation of commercial embedded systems, lessons learnt from previous mistakes, wisdom passed down from others, and results obtained from academic research These elements join together to form useful insights, guidelines, and recommendations that you can actually use in your real-time embedded systems projects This book provides a solid understanding of real-time embedded systems with detailed practical examples and industry knowledge on key concepts, design issues, and solu tions This book supplies a rich set of ready-to-use embedded design building blocks that can accelerate your development efforts and increase your productivity I hope that Real-Time Concepts for Embedded Systems will become a key reference for you as you embark upon your development endeavors If you would like to sign up for e-mail news updates, please send a blank e-mail to: rtconcepts@news.cmpbooks.com If you have a suggestion, correction, or addition to make to the book, e-mail me at qingli@speakeasy.net Audience for this Book This book is oriented primarily toward junior to intermediate software developers work ing in the realm of embedded computing This document is created with the unregistered version of CHM2PDF Pilot If you are an experienced developer but new to real-time embedded systems develop ment, you will also find the approach to design in this book quite useful If you are a technical manager who is active in software design reviews of real-time systems, you can refer to this book to become better informed regarding the design and implementation phases This book can also be used as complementary reference material if you are an engineering or computer science student Before using this book, you should be proficient in at least one programming language and should have some exposure to the software-development process This document is created with the unregistered version of CHM2PDF Pilot Acknowledgments We would like to thank the team at CMP Books and especially Paul Temme, Michelle O'Neal, Marc Briand, Brandy Ernzen, and Robert Ward We wish to express our thanks to the reviewers Jerry Krasner, Shin Miyakawa, Jun-ichiro itojun Hagino, and Liliana Britvic for their contributions We would like to thank Nauman Arshad for his initial participation on this project We would also like to thank Anne-Marie Eileraas, Salvatore LiRosi, Loren Shade, and numerous other individuals at Wind River for their support Finally, thanks go to our individual families for their love and support, Huaying and Jane Lee, Maya and William Yao This document is created with the unregistered version of CHM2PDF Pilot Index S scalability 62 schedulability 226-229 schedulable entity 57 scheduler 46, 56-61, 69, 133, 160, 171, 175, 182, 217, 239-240, 260, 274 scheduling algorithm 56, 59-61, 69, 226 delay 163, 174-175 policy 55, 59 schematic 28, 170 SDRAM 32, 34 SECTION 28-30, 33 section 24-28 header table 24-25, 43 select 112, 114, 116-117 semaphore 57, 61, 79-95, 138, 234 control block 79 counting 81, 209-210, 246 mutex 82-87, 91-94, 126-129, 209-211, 233, 235-236, 245-246, 254 sequence control 233 sequential 65, 222 cohesion 219, 225, 229 services 56, 62, 133-141, 150-163, 167-185 signal 121-126 control block 122-123 facility 125, 244 glitch 163 handler 122, 124-125, 255 Simple Network Management Protocol See SNMP SNMP 134 SoC soft real-time system 14 soft timer 171 soft-timer facility See timer facility software interrupt 121-126 sporadic 158, 164 spurious interrupt 163-165 SRAM stable deadlock 263 stack overflow 156-158 stack pointer 40, 43-44, 153, 158 starvation 71, 259 This document is created with the unregistered version of CHM2PDF Pilot Static RAM See SRAM status register 152, 160 stray pointer 145 stubs 135 supervisor stack 153 suspended 67-68, 73, 75 symbol relocation 22-23 resolution 22, 24, 28 table 23 symbol resolution 22 synchronization 57, 61, 77, 79, 87-94, 107, 111, 117, 120, 125, 133, 209, 211, 213, 225, 227, 231-236 synchronous 10, 149-150, 219-221 exception 144, 149-150, 155, 160 system call 59, 63, 137 system clock 168-169, 171, 182, 184 system reset exception 144 system-on-a-chip See SoC This document is created with the unregistered version of CHM2PDF Pilot Index T target system 8, 20-21, 27-29, 32, 34-52, 137-139 task 61, 65-78, 138 control block 58, 66, 119, 122, 152, 250 deletion lock 74, 83 routine 66-67 state 67 structure 76 task-ready list 69-70 TCP/IP 51, 133-134, 139-140 Telnet 134 temporal cohesion 218, 225, 229 deadlock 263 TFTP 38 thread 46, 57-58, 61, 65, 77, 79, 90, 217, 231, 259-260, 264 throughput 63 tick 170-171, 174-175, 177-178, 182-183, 238, 251, 254 tightly coupled communication 107, 236-237 time slicing 60-61 timer See Chapter 11 timer chip 169 timer facility 171-176 timer interrupt 170 rate register 170 timer services See Chapter 11 timing anomaly 275 correctness 13, 15-16 wheel 176, 179-182 hierarchical 180 TRAP 145 triggering mechanism 160, 164 Trivial File Transfer Protocol See TFTP This document is created with the unregistered version of CHM2PDF Pilot Index U UDP 134 unbounded priority inversion 274-276 uniform I/O 192, 195-197 uniprocessor 57, 233 universal processor unlock 74, 82-83, 85-86, 91, 94, 128-129, 210, 236, 254, 257 unnamed pipe 113-114 unresolved external symbol 22 updates to book xii urgency 218, 223-224, 244-245, 255 user stack 153 utilization bound 226 factor 226 This document is created with the unregistered version of CHM2PDF Pilot Index V vector 149, 155 address 148, 152, 155 control 147 reset 39, 43, 48 system exception 41 table 124, 149, 152, 155, 182 This document is created with the unregistered version of CHM2PDF Pilot Index W web tablet This document is created with the unregistered version of CHM2PDF Pilot Index X XDR 136 This document is created with the unregistered version of CHM2PDF Pilot List of Figures Chapter 1: Introduction Figure 1.1: Embedded systems at home Figure 1.2: Embedded systems at work Figure 1.3: Navigation system and portable music player Figure 1.4: A web tablet Figure 1.5: A simple view of real-time systems Figure 1.6: Real-time embedded systems Figure 1.7: Structure of real-time systems Chapter 2: Basics Of Developing For Embedded Systems Figure 2.1: Typical cross-platform development environment Figure 2.2: Creating an image file for the target system Figure 2.3: Relationship between the symbol table and the relocation table Figure 2.4: Executable and linking format Figure 2.5: Simplified schematic and memory map for a target system Figure 2.6: Combining input sections into an executable image Figure 2.7: Mapping an executable image into the target system Figure 2.8: Mapping an executable image into the target system Chapter 3: Embedded System Initialization Figure 3.1: View of the target embedded system Figure 3.2: Example bootstrap overview Figure 3.3: Boot sequence for an image running from ROM Figure 3.4: Boot sequence for an image executing from RAM after transfer from ROM Figure 3.5: Boot sequence for an image executing from RAM after transfer from the host system Figure 3.6: Software components of a target image Figure 3.7: The software initialization process Chapter 4: Introduction To Real-Time Operating Systems Figure 4.1: High-level view of an RTOS, its kernel, and other components found in embedded systems Figure 4.2: Common components in an RTOS kernel that including objects, the scheduler, and some services Figure 4.3: Multitasking using a context switch Figure 4.4: Preemptive priority-based scheduling Figure 4.5: Round-robin and preemptive scheduling Chapter 5: Tasks Figure 5.1: A task, its associated parameters, and supporting data structures Figure 5.2: A typical finite state machine for task execution states Figure 5.3: Five steps showing the way a task-ready list works This document is created with the unregistered version of CHM2PDF Pilot Chapter 6: Semaphores Figure 6.1: A semaphore, its associated parameters, and supporting data structures Figure 6.2: The state diagram of a binary semaphore Figure 6.3: The state diagram of a counting semaphore Figure 6.4: The state diagram of a mutual exclusion (mutex) semaphore Figure 6.5: Wait-and-signal synchronization between two tasks Figure 6.6: Wait-and-signal synchronization between multiple tasks Figure 6.7: Credit-tracking synchronization between two tasks Figure 6.8: Single shared-resource-access synchronization Figure 6.9: Recursive shared- resource-access synchronization Figure 6.10: Single shared-resource-access synchronization Chapter 7: Message Queues Figure 7.1: A message queue, its associated parameters, and supporting data structures Figure 7.2: The state diagram for a message queue Figure 7.3: Message copying and memory use for sending and receiving messages Figure 7.4: Sending messages in FIFO or LIFO order Figure 7.5: FIFO and priority-based task-waiting lists Figure 7.6: Non-interlocked, one-way data communication Figure 7.7: Interlocked, one-way data communication Figure 7.8: Interlocked, two-way data communication Figure 7.9: Broadcasting messages Chapter 8: Other Kernel Objects Figure 8.1: A common pipe-unidirectional Figure 8.2: Common pipe operation Figure 8.3: Pipe control block Figure 8.4: States of a pipe Figure 8.5: The select operation on multiple pipes Figure 8.6: Using pipes for inter-task synchronization Figure 8.7: Event register Figure 8.8: Event register control block Figure 8.9: Identifying an event source Figure 8.10: Signals Figure 8.11: Signal control block Figure 8.12: The catch operation Figure 8.13: Condition variable Figure 8.14: Condition variable control block Figure 8.15: Execution sequence of wait and signal operations Chapter 9: Other RTOS Services Figure 9.1: Overview Figure 9.2: TCP/IP protocol stack component Figure 9.3: File system component Figure 9.4: Remote procedure calls Figure 9.5: RTOS command shell Chapter 10: Exceptions and Interrupts Figure 10.1: Programmable interrupt controller Figure 10.2: System-wide priority scheme Figure 10.3: Store processor state information onto stack Figure 10.4: Task TCB and stack Figure 10.5: Loading exception vector Figure 10.6: Interrupt nesting Figure 10.7: Nested interrupts and stack overflow Figure 10.8: Switching SP to exception frame Figure 10.9: Exception timing Figure 10.10: Interrupt processing in two contexts Figure 10.11: Edge triggering on either rising or falling edge Figure 10.12: Level triggering Figure 10.13: Real signals Chapter 11: Timer and Timer Services Figure 11.1: A real-time clock Figure 11.2: System clock initialization Figure 11.3: Steps in servicing the timer interrupt Figure 11.4: A model for soft-timer handling facility Figure 11.5: Servicing the timer interrupt in the task context Figure 11.6: Level delays-timer event notification delay Figure 11.7: Level delays-priority-based, This document is created with the unregistered version of CHM2PDF Pilot task-scheduling delays Figure 11.8: Maintaining soft timers Figure 11.9: Unsorted soft timers Figure 11.10: Sorted soft timers Figure 11.11: Timing wheel Figure 11.12: Timeout event handlers Figure 11.13: Installing a timeout event Figure 11.14: Timing wheel overflow event buffer Figure 11.15: Unbounded soft-timer handler invocation Figure 11.16: A hierarchical timing wheel Chapter 12: I/O Subsystem Figure 12.1: I/O subsystem and the layered model Figure 12.2: Port-mapped I/O Figure 12.3: Memory-mapped I/O Figure 12.4: DMA I/O Figure 12.5: Servicing a write operation for a block-mode device Figure 12.6: I/O function mapping Figure 12.7: Uniform I/O driver table Figure 12.8: Associating devices with drivers Chapter 13: Memory Management Figure 13.1: States of a memory allocation map Figure 13.2: Memory allocation map with possible fragmentation Figure 13.3: Static array implementation of the allocation map Figure 13.4: Free blocks in a heap arrangement Figure 13.5: The free operation Figure 13.6: Management based on memory pools Figure 13.7: Implementing a blocking allocation function using a mutex and a counting semaphore Chapter 14: Modularizing An Application For Concurrency Figure 14.1: High-level context diagram of a mobile handheld unit Figure 14.2: Using the outside-in approach to decompose an application into tasks Figure 14.3: Pseudo and true concurrent (parallel) execution Figure 14.4: Some general properties of active and passive devices Figure 14.5: General communication mechanisms for active I/O devices Figure 14.6: General communication mechanisms for passive I/O devices Figure 14.7: Example setup for extended RMA Chapter 15: Synchronization And Communication Figure 15.1: Multiple tasks accessing shared memory Figure 15.2: Visualization of barrier synchronization Figure 15.3: Simple rendezvous without data passing Figure 15.4: Loosely coupled ISR-to-task communication using message queues Figure 15.5: Tightly coupled task-to-task communication using message queues Figure 15.6: Task-to-task synchronization using binary semaphores Figure 15.7: ISR-to-task synchronization using binary semaphores Figure 15.8: Task-to-task synchronization using event registers Figure 15.9: ISR-to-task synchronization using event registers Figure 15.10: ISR-to-task synchronization using counting semaphores Figure 15.11: Task-to-task rendezvous using two message queues Figure 15.12: Using signals for urgent data communication Figure 15.13: Task-to-task resource synchronization-shared memory guarded by mutex Figure 15.14: ISR-to-task resource synchronization- shared memory guarded by interrupt lock Figure 15.15: Task-to-task resource synchronization-shared memory guarded by preemption lock Figure 15.16: Sharing multiple instances of resources using counting semaphores and mutexes Figure 15.17: Using counting semaphores for flow control Figure 15.18: Task waiting on multiple input sources Figure 15.19: Task with multiple input communication channels Figure 15.20: Using condition variables for task synchronization Figure 15.21: Using signals for urgent data communication Chapter 16: Common Design Problems This document is created with the unregistered version of CHM2PDF Pilot Figure 16.1: Deadlock situation between two tasks Figure 16.2: Deadlock situation among three tasks Figure 16.3: Current state of resource allocations and requests Figure 16.4: Resource preemption with a new deadlock Figure 16.5: Deadlock eliminated by proper resource reassignment Figure 16.6: Priority inversion example Figure 16.7: Unbounded priority inversion example Figure 16.8: Priority inheritance protocol example Figure 16.9: Transitive priority promotion example Figure 16.10: Ceiling priority protocol example This document is created with the unregistered version of CHM2PDF Pilot List of Tables Chapter 2: Basics Of Developing For Embedded Systems Table 2.1: Section types Table 2.2: Section attributes Table 2.3: Example embedded application with sections Chapter 4: Introduction To Real-Time Operating Systems Table 4.1: Categorizing highly available systems by allowable downtime.1 Chapter 5: Tasks Table 5.1: Operations for task creation and deletion Table 5.2: Operations for task scheduling Table 5.3: Task-information operations Chapter 6: Semaphores Table 6.1: Semaphore creation and deletion operations Table 6.2: Semaphore acquire and release operations Table 6.3: Semaphore unblock operations Table 6.4: Semaphore information operations Chapter 7: Message Queues Table 7.1: Message queue creation and deletion operations Table 7.2: Sending and receiving messages Table 7.3: Obtaining message queue information operations Chapter 8: Other Kernel Objects Table 8.1: Create and destroy operations Table 8.2: Read and write operations Table 8.3: Control operations Table 8.4: Select operations Table 8.5: Event register operations Table 8.6: Signal operations Table 8.7: Condition variable operations Chapter 10: Exceptions and Interrupts This document is created with the unregistered version of CHM2PDF Pilot Table 10.1: Interrupt table Table 10.2: Exception priorities Chapter 11: Timer and Timer Services Table 11.1: Group Operations Table 11.2: Group Operations Table 11.3: Group Operations Chapter 12: I/O Subsystem Table 12.1: I/O functions Chapter 14: Modularizing An Application For Concurrency Table 14.1: Common tasks that interface with active I/O devices Table 14.2: Common tasks that interface with passive I/O devices Table 14.3: Properties of tasks Chapter 16: Common Design Problems Table 16.1: Priority Inheritance Protocol rules Table 16.2: Ceiling priority protocol rules Table 16.3: Priority ceiling protocol rules This document is created with the unregistered version of CHM2PDF Pilot List of Listings Chapter 2: Basics Of Developing For Embedded Systems Listing 2.1: Section header and program header Listing 2.2: Memory map Listing 2.3: SECTION command Listing 2.4: Example code Listing 2.5: Possible section allocation Chapter 5: Tasks Listing 5.1: Pseudo code for a run-to-completion task Listing 5.2: Pseudo code for an endless-loop task Chapter 6: Semaphores Listing 6.1: Pseudo code for wait-and-signal synchronization Listing 6.2: Pseudo code for wait-and-signal synchronization Listing 6.3: Pseudo code for credit-tracking synchronization Listing 6.4: Pseudo code for tasks accessing a shared resource Listing 6.5: Pseudo code for recursively accessing a shared resource Listing 6.6: Pseudo code for multiple tasks accessing equivalent shared resources Listing 6.7: Pseudo code for multiple tasks accessing equivalent shared resources using mutexes Chapter 7: Message Queues Listing 7.1: Pseudo code for non-interlocked, one-way data communication Listing 7.2: Pseudo code for interlocked, one-way data communication Listing 7.3: Pseudo code for interlocked, two-way data communication Listing 7.4: Pseudo code for broadcasting messages Chapter 8: Other Kernel Objects Listing 8.1: Pseudo code for wait and the signal operations Chapter 9: Other RTOS Services Listing 9.1: The sys_comp.h inclusion header file Listing 9.2: The net_conf.h configuration file Listing 9.3: The net_conf.c configuration file This document is created with the unregistered version of CHM2PDF Pilot Chapter 12: I/O Subsystem Listing 12.1: C structure defining the uniform I/O API set Listing 12.2: Mapping uniform I/O API to specific driver functions Chapter 13: Memory Management Listing 13.1: Pseudo code for memory allocation Listing 13.2: Pseudo code for memory deallocation Chapter 15: Synchronization And Communication Listing 15.1: Pseudo code for barrier synchronization Listing 15.2: Pseudo code for data transfer with flow control Listing 15.3: Pseudo code for task waiting on multiple input sources Listing 15.4: Pseudo code for using a counting semaphore for event accumulation combined with an event-register used for event notification Listing 15.5: Pseudo code for reader tasks Listing 15.6: Pseudo code for writer tasks Listing 15.7: Data structure for implementing reader-writer locks Listing 15.8: Code called by the writer task to acquire and release locks Listing 15.9: Code called by the reader task to acquire and release locks Chapter 16: Common Design Problems Listing 16.1: Checkpoints and recovery routine [...]... in real time This category is classified as the real- time embedded system As an introduction to embedded systems and real- time embedded systems, this chapter focuses on: • examples of embedded systems, • defining embedded systems, • defining embedded systems with real- time behavior, and • current trends in embedded systems This document is created with the unregistered version of CHM2PDF Pilot 1.1 Real. .. designed • Real- time systems are characterized by the fact that timing correctness is just as important as functional or logical correctness • The severity of the penalty incurred for not satisfying timing constraints differentiates hard real- time systems from soft real- time systems • Real- time systems have a significant amount of application awareness similar to embedded systems • Real- time embedded systems. .. not all embedded systems exhibit real- time behaviors nor are all real- time systems embedded However, the two systems are not mutually exclusive, and the area in which they overlap creates the combination of systems known as real- time embedded systems Figure 1.6: Real- time embedded systems Knowing this fact and because we have covered the various aspects of embedded systems in the previous sections,... unregistered version of CHM2PDF Pilot 1.2 Real- Time Embedded Systems In the simplest form, real- time systems can be defined as those systems that respond to external events in a timely fashion, as shown in Figure 1.5 The response time is guaranteed We revisit this definition after presenting some examples of real- time systems Figure 1.5: A simple view of real- time systems External events can have synchronous... correctness In some real- time systems, functional correctness is sometimes sacrificed for timing correctness We address this point shortly after we introduce the classifications of real- time systems Similar to embedded systems, real- time systems also have substantial knowledge of the environment of the controlled system and the applications running on it This reason is one why many real- time systems are said... material for additional coverage on this topic This document is created with the unregistered version of CHM2PDF Pilot 1.2.3 Hard and Soft Real- Time Systems In the previous section, we said computation must complete before reaching a given deadline In other words, real- time systems have timing constraints and are deadline-driven Real- time systems can be classified, therefore, as either hard real- time systems. .. therefore, as either hard real- time systems or soft real- time systems What differentiates hard real- time systems and soft real- time systems are the degree of tolerance of missed deadlines, usefulness of computed results after missed deadlines, and severity of the penalty incurred for failing to meet deadlines For hard real- time systems, the level of tolerance for a missed deadline is extremely small or zero... sections, we can now focus our attention on real- time systems Figure 1.7: Structure of real- time systems 1.2.1 Real- Time Systems This document is created with the unregistered version of CHM2PDF Pilot The environment of the real- time system creates the external events These events are received by one or more components of the real- time system The response of the real- time system is then injected into its... hard real- time system, the deadline is a deterministic value, and, for a soft real- time system, the value can be estimation One thing worth noting is that the length of the deadline does not make a real- time system hard or soft, but it is the requirement for meeting it within that time The weapons defense and the missile guidance systems are hard real- time systems Using the missile guidance system for. .. performing the required processing as a result of the event, and outputting the necessary results within a given time constraint Timing constraints include finish time, or both start time and finish time A good way to understand the relationship between real- time systems and embedded systems is to view them as two intersecting circles, as shown in Figure 1.6 It can be seen that not all embedded systems ... introduction to embedded systems and real- time embedded systems, this chapter focuses on: • examples of embedded systems, • defining embedded systems, • defining embedded systems with real- time behavior,... 1.2 Real- Time Embedded Systems In the simplest form, real- time systems can be defined as those systems that respond to external events in a timely fashion, as shown in Figure 1.5 The response time. .. on real- time systems Figure 1.7: Structure of real- time systems 1.2.1 Real- Time Systems This document is created with the unregistered version of CHM2PDF Pilot The environment of the real- time

Ngày đăng: 08/03/2016, 11:37

Từ khóa liên quan

Mục lục

  • Table of Contents

  • BackCover

  • Real-Time Concepts for Embedded Systems

  • Foreword

  • Preface

    • Acknowledgments

    • Chapter 1: Introduction

      • 1.1 Real Life Examples of Embedded Systems

      • 1.2 Real-Time Embedded Systems

      • 1.3 The Future of Embedded Systems

      • 1.4 Points to Remember

      • Chapter 2: Basics Of Developing For Embedded Systems

        • 2.2 Overview of Linkers and the Linking Process

        • 2.3 Executable and Linking Format

        • 2.4 Mapping Executable Images into Target Embedded Systems

        • 2.5 Points to Remember

        • Chapter 3: Embedded System Initialization

          • 3.2 Target System Tools and Image Transfer

          • 3.3 Target Boot Scenarios

          • 3.4 Target System Software Initialization Sequence

          • 3.5 On-Chip Debugging

          • 3.6 Points to Remember

          • Chapter 4: Introduction To Real-Time Operating Systems

            • 4.2 A Brief History of Operating Systems

            • 4.3 Defining an RTOS

Tài liệu cùng người dùng

Tài liệu liên quan