没有合适的资源?快使用搜索试试~ 我知道了~
首页Getting_Started_with_QNX_Neutrino.pdf
资源详情
资源评论
资源推荐
Getting Started with QNX
®
Neutrino
®
: A Guide for
Realtime Programmers
QNX
®
Software Development Platform 7.0
©
1999–2020, QNX Software Systems Limited, a subsidiary of BlackBerry
Limited. All rights reserved.
QNX Software Systems Limited
1001 Farrar Road
Ottawa, Ontario
K2K 0B3
Canada
Voice: +1 613 591-0931
Fax: +1 613 591-3579
Email: info@qnx.com
Web: http://www.qnx.com/
Trademarks, including but not limited to BLACKBERRY, EMBLEM
Design, QNX, MOMENTICS, NEUTRINO, and QNX CAR, are the
trademarks or registered trademarks of BlackBerry Limited, its
subsidiaries and/or affiliates, used under license, and the exclusive
rights to such trademarks are expressly reserved. All other trademarks
are the property of their respective owners.
Patents per 35 U.S.C. § 287(a) and in other jurisdictions, where allowed:
http://www.blackberry.com/patents
Electronic edition published: March 06, 2020
Contents
About This Guide..................................................................................................................................9
Typographical conventions........................................................................................................10
Technical support.....................................................................................................................12
Foreword to the First Edition by Peter van der Veen................................................................................13
Preface to the First Edition by Rob Krten...............................................................................................15
A little history..........................................................................................................................16
Who this book is for..................................................................................................................17
What's in this book?.................................................................................................................18
About Rob Krten......................................................................................................................20
Acknowledgments....................................................................................................................21
Chapter 1: Processes and Threads........................................................................................................23
Process and thread fundamentals..............................................................................................24
A process as a house.....................................................................................................24
The occupants as threads..............................................................................................24
Back to processes and threads.......................................................................................24
Mutual exclusion...........................................................................................................25
Priorities......................................................................................................................25
Semaphores..................................................................................................................26
A semaphore as a mutex................................................................................................27
The kernel's role......................................................................................................................28
Single CPU...................................................................................................................28
Multiple CPU (SMP)......................................................................................................28
The kernel as arbiter......................................................................................................28
Kernel states................................................................................................................32
Threads and processes..............................................................................................................34
Why processes?.............................................................................................................34
Starting a process.........................................................................................................35
Starting a thread...........................................................................................................46
More on synchronization...........................................................................................................68
Readers/writer locks......................................................................................................68
Sleepon locks...............................................................................................................70
Condition variables........................................................................................................74
Additional OS services...................................................................................................80
Pools of threads............................................................................................................80
An example of synchronization.......................................................................................88
Scheduling and the real world...................................................................................................96
Rescheduling: hardware interrupts..................................................................................96
Rescheduling: kernel calls.............................................................................................96
Rescheduling: exceptions...............................................................................................97
Summary......................................................................................................................97
Chapter 2: Message Passing.................................................................................................................99
Getting Started with QNX
®
Neutrino
®
: A Guide for Realtime Programmers
A small microkernel and message passing................................................................................100
Message passing and client/server...........................................................................................102
Network-distributed message passing.......................................................................................105
What it means for you.............................................................................................................106
Multiple threads.....................................................................................................................107
Server/subserver..........................................................................................................107
Some examples...........................................................................................................109
Using message passing...........................................................................................................111
Architecture & structure...............................................................................................111
The client...................................................................................................................112
The server..................................................................................................................114
Identifying messages...................................................................................................118
The send-hierarchy......................................................................................................119
Receive IDs, channels, and other parameters.................................................................119
Multipart messages.....................................................................................................129
Pulses...................................................................................................................................135
Receiving a pulse message...........................................................................................135
The
MsgDeliverEvent()
function..............................................................................138
Channel flags..............................................................................................................139
Message passing over a network..............................................................................................145
Networked message passing differences........................................................................147
Some notes on NDs.....................................................................................................148
Priority inheritance.................................................................................................................151
So what's the trick?.....................................................................................................153
Summary....................................................................................................................153
Chapter 3: Clocks, Timers, and Getting a Kick Every So Often...............................................................155
Clocks and timers..................................................................................................................156
Operating periodically..................................................................................................156
Clock interrupt sources................................................................................................158
Base timing resolution.................................................................................................158
Timing jitter................................................................................................................159
Types of timers...........................................................................................................160
Notification schemes...................................................................................................160
Using timers..........................................................................................................................165
Creating a timer..........................................................................................................165
Signal, pulse, or thread?..............................................................................................165
What kind of timer?.....................................................................................................166
A server with periodic pulses........................................................................................168
Timers delivering signals..............................................................................................177
Timers creating threads................................................................................................177
Getting and setting the realtime clock and more.............................................................177
Advanced topics.....................................................................................................................180
Other clock sources.....................................................................................................180
Kernel timeouts..........................................................................................................182
Summary....................................................................................................................185
Contents
Chapter 4: Interrupts.........................................................................................................................187
QNX Neutrino and interrupts...................................................................................................188
Interrupt service routine...............................................................................................189
Level-sensitivity versus edge-sensitivity.........................................................................191
Writing interrupt handlers.......................................................................................................194
Attaching an interrupt handler......................................................................................194
Now that you've attached an interrupt...........................................................................195
Detaching an interrupt handler.....................................................................................196
The
flags
parameter...................................................................................................196
The interrupt service routine........................................................................................197
ISR functions.............................................................................................................205
Summary..............................................................................................................................208
Chapter 5: Resource Managers...........................................................................................................209
What is a resource manager?...................................................................................................210
Examples of resource managers....................................................................................210
Characteristics of resource managers............................................................................210
The client's view....................................................................................................................212
Finding the server.......................................................................................................212
Finding the process manager........................................................................................213
Handling directories....................................................................................................214
Unioned filesystems....................................................................................................215
Client summary...........................................................................................................217
The resource manager's view...................................................................................................218
Registering a pathname...............................................................................................218
Handling messages.....................................................................................................219
The resource manager library...................................................................................................220
The library really does what we just talked about............................................................221
Behind the scenes at the library...................................................................................222
Writing a resource manager.....................................................................................................225
Data structures...........................................................................................................225
Resource manager structure.........................................................................................231
POSIX-layer data structures..........................................................................................240
Handler routines....................................................................................................................249
General notes.............................................................................................................249
Connect functions notes..............................................................................................251
Alphabetical listing of connect and I/O functions.......................................................................253
Access control list I/O function handler.........................................................................253
Change file mode I/O function handler..........................................................................254
Change ownership I/O function handler.........................................................................256
Change timestamps I/O function handler.......................................................................257
Close duplicate OCB I/O function handler......................................................................258
Close OCB I/O function handler....................................................................................260
Create file link connect function handler.......................................................................261
Device control I/O function handler...............................................................................263
Duplicate a file descriptor I/O function handler..............................................................267
Getting Started with QNX
®
Neutrino
®
: A Guide for Realtime Programmers
剩余425页未读,继续阅读
日拱一卒不期而至
- 粉丝: 252
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0