没有合适的资源?快使用搜索试试~ 我知道了~
首页c_user.RTEMS_C语言用户指南.双语.V20131224
资源详情
资源评论
资源推荐

RTEMS C User’s Guide
Edition 4.10.99.0, for RTEMS 4.10.99.0
24 February 2013
RTEMS C
语言用户指南
版本:4.10.99.0,适用于 RTEMS 4.10.99.0
2013 年 2 月 24 日
(译注:本文档的英文原版经常更新,但本页上所注的日期并不更新,本次翻译
所依据的英文原版是 20130610 版。)
翻译:Tony Zhu bizasia@126.com
On-Line Applications Research Corporation
在线应用研究公司

On-Line Applications Research Corporation
TEXinfo 2012-11-08.11
在线应用研究公司
TEXinfo 2012-11-08.11
COPYRIGHT c 1988 - 2013.
On-Line Applications Research Corporation (OAR).
版权所有 c 1988 - 2013
在线应用研究公司
The authors have used their best efforts in preparing this material. These efforts
include the development, research, and testing of the theories and programs to
determine their effectiveness. No warranty of any kind, expressed or implied, with
regard to the software or the material contained in this document is provided. No
liability arising out of the application or use of any product described in this
document is assumed. The authors reserve the right to revise this material and to
make changes from time to time in the content hereof without obligation to notify
anyone of such revision or changes. The RTEMS Project is hosted at http: /
/www .rtems .com. Any inquiries concerning RTEMS, its related support components,
its documentation, or any custom services for RTEMS should be directed to the
contacts listed on that site. A current list of RTEMS Support Providers is at
http://www.rtems.com/oarsupport.
作者已经尽最大努力编制本材料。这些努力包括理论和程序的开发、研究与测试
以确定它们的有效性。对于软件或包含在本文档中的材料,我们不提供任何类型
的明示或暗示的保证。我们不承担本文档所描述的在应用程序或产品的使用中所
产生的责任。作者保留修改本材料和不定期改变内容的权利,对这些修改没有义
务通知任何人。RTEMS 项目托管在 http://www .rtems .com。任何涉及 RTEMS 的
查询、相关的支持组件、文档或任何定制服务,可以通过在该网站上的通讯录联
系。一个当前的 RTEMS 支持提供者列表在 http://www.rtems.com/oarsupport。

3
Table of Contents
List of Figures ······································································· 47
Preface ················································································· 49
1 Overview ········································································ 55
1.1 Introduction ································································································· 55
1.2 Real-time Application Systems ····································································· 56
1.3 Real-time Executive ······················································································ 57
1.4 RTEMS Application Architecture ·································································· 59
1.5 RTEMS Internal Architecture ········································································ 60
1.6 User Customization and Extensibility ·························································· 64
1.7 Portability ····································································································· 64
1.8 Memory Requirements ················································································ 65
1.9 Audience ······································································································ 65
1.10 Conventions ······························································································· 66
1.11 Manual Organization ·················································································· 67
2 Key Concepts ·································································· 73
2.1 Introduction ································································································· 73
2.2 Objects ········································································································· 73
2.2.1 Object Names ····················································································· 74
2.2.2 Object IDs ··························································································· 75
2.2.2.1 Thirty-Two Object ID Format ··················································· 75
2.2.2.2 Sixteen Bit Object ID Format ···················································· 76
2.2.3 Object ID Description ········································································· 77
2.3 Communication and Synchronization ·························································· 78
2.4 Time ············································································································· 80
2.5 Memory Management ················································································· 82
3 RTEMS Data Types ·························································· 83
3.1 Introduction ································································································· 83
3.2 List of Data Types ························································································· 83

4
4 Scheduling Concepts ······················································· 93
4.1 Introduction ································································································· 93
4.2 Scheduling Algorithms ················································································· 93
4.2.1 Priority Scheduling ············································································· 94
4.2.2 Deterministic Priority Scheduler ························································ 96
4.2.3 Simple Priority Scheduler ··································································· 96
4.2.4 Simple SMP Priority Scheduler ·························································· 97
4.2.5 Earliest Deadline First Scheduler ······················································· 97
4.2.6 Constant Bandwidth Server Scheduling (CBS) ··································· 99
4.3 Scheduling Modification Mechanisms ······················································· 100
4.3.1 Task Priority and Scheduling ···························································· 101
4.3.2 Preemption ······················································································ 101
4.3.3 Timeslicing ······················································································· 101
4.3.4 Manual Round-Robin ······································································· 102
4.4 Dispatching Tasks ······················································································· 102
4.5 Task State Transitions ················································································· 103
5 Initialization Manager··················································· 111
5.1 Introduction ······························································································· 111
5.2 Background ································································································ 111
5.2.1 Initialization Tasks ············································································ 112
5.2.2 System Initialization ········································································· 112
5.2.3 The Idle Task ····················································································· 113
5.2.4 Initialization Manager Failure ·························································· 113
5.3 Operations ································································································· 115
5.3.1 Initializing RTEMS ············································································· 115
5.3.2 Shutting Down RTEMS ····································································· 117
5.4 Directives ··································································································· 117
5.4.1 INITIALIZE_DATA_STRUCTURES - Initialize RTEMS Data Structures · 118
5.4.2 INITIALIZE_BEFORE_DRIVERS - Perform Initialization Before Device
Drivers ······························································································ 119
5.4.3 INITIALIZE_DEVICE_DRIVERS - Initialize Device Drivers ··················· 120
5.4.4 INITIALIZE_START_MULTITASKING – Complete Initialization and Start
Multitasking ····················································································· 122
5.4.5 SHUTDOWN_EXECUTIVE - Shutdown RTEMS ·································· 124
6 Task Manager ······························································· 125

5
6.1 Introduction ······························································································· 125
6.2 Background ································································································ 126
6.2.1 Task Definition ·················································································· 127
6.2.2 Task Control Block ············································································ 127
6.2.3 Task States ························································································ 128
6.2.4 Task Priority ······················································································ 129
6.2.5 Task Mode ························································································ 130
6.2.6 Accessing Task Arguments ······························································· 133
6.2.7 Floating Point Considerations ·························································· 133
6.2.8 Per Task Variables ············································································· 135
6.2.9 Building a Task Attribute Set ···························································· 136
6.2.10 Building a Mode and Mask ···························································· 137
6.3 Operations ································································································· 139
6.3.1 Creating Tasks ·················································································· 139
6.3.2 Obtaining Task IDs ············································································ 140
6.3.3 Starting and Restarting Tasks ··························································· 140
6.3.4 Suspending and Resuming Tasks ······················································ 141
6.3.5 Delaying the Currently Executing Task ············································· 142
6.3.6 Changing Task Priority ······································································ 142
6.3.7 Changing Task Mode ········································································ 143
6.3.8 Notepad Locations ··········································································· 143
6.3.9 Task Deletion ···················································································· 143
6.4 Directives ··································································································· 144
6.4.1 TASK_CREATE - Create a task ··························································· 145
6.4.2 TASK_IDENT - Get ID of a task ·························································· 150
6.4.3 TASK_SELF - Obtain ID of caller ························································ 152
6.4.4 TASK_START - Start a task ································································· 153
6.4.5 TASK_RESTART - Restart a task ························································· 155
6.4.6 TASK_DELETE - Delete a task ···························································· 157
6.4.7 TASK_SUSPEND - Suspend a task ····················································· 159
6.4.8 TASK_RESUME - Resume a task ······················································· 161
6.4.9 TASK_IS_SUSPENDED - Determine if a task is Suspended ··············· 163
6.4.10 TASK_SET_PRIORITY - Set task priority ·········································· 164
6.4.11 TASK_MODE - Change the current task mode ······························· 166
6.4.12 TASK_GET_NOTE - Get task notepad entry ···································· 169
6.4.13 TASK_SET_NOTE - Set task notepad entry ····································· 171
6.4.14 TASK_WAKE_AFTER - Wake up after interval ································· 173
6.4.15 TASK_WAKE_WHEN - Wake up when specified ····························· 174
剩余736页未读,继续阅读







安全验证
文档复制为VIP权益,开通VIP直接复制

评论7