没有合适的资源?快使用搜索试试~ 我知道了~
首页VxWorks内核开发指南:问题与实战精华
VxWorks内核开发文档是一份详细的指南,专为从事VxWorks内核编程的开发者设计,版本为6.9。该文档版权属于WindRiver Systems, Inc., 公司,强调所有内容未经该公司事先书面许可不得复制或传播。VxWorks、Tornado和WindRiver是该公司的注册商标。
VxWorks是一款嵌入式实时操作系统,其内核程序员指南深入探讨了内核开发过程中可能遇到的关键问题和最佳实践。这份文档涵盖了内核设计、模块化开发、内存管理、进程调度、中断处理、同步与互斥、以及异常处理等核心概念。它帮助开发者理解如何构建高效、稳定且可扩展的VxWorks内核,确保系统在严苛的实时性要求下运行。
在内核开发过程中,文档特别关注以下几个方面:
1. **内核架构**:介绍VxWorks内核的基本组成,包括内核模式和用户模式的执行环境,以及它们之间的交互方式。
2. **模块化设计**:提倡将复杂的内核功能分解为可独立编译和加载的模块,提高维护性和灵活性。
3. **内存管理**:讲解内存分配策略,包括静态内存分配、动态内存池管理和虚拟内存的使用。
4. **进程管理**:阐述进程创建、调度、通信和同步机制,如任务调度算法和信号量的使用。
5. **中断处理**:详细解释中断服务程序的编写规范和中断向量表的设计,确保系统的实时响应能力。
6. **异常处理**:讨论错误处理和恢复机制,确保在硬件故障或软件错误时,系统的稳定性。
7. **第三方软件许可**:提醒读者注意产品安装目录中可能包含的第三方软件许可协议,以避免法律纠纷。
通过阅读这份文档,开发者不仅可以掌握内核编程的基础知识,还能了解到如何遵循WindRiver的开发实践,确保所开发的内核组件符合VxWorks的整体架构和标准。对于任何希望深入VxWorks技术栈的工程师来说,这是一份极其宝贵的参考资料。
VxWorks
Kernel Programmer's Guide, 6.9
xvi
12.12.1 Creating Network Devices ............................................................................... 314
12.12.2 I/O Control Functions ...................................................................................... 314
12.13 Sockets ............................................................................................................................... 314
12.14 Internal I/O System Structure ....................................................................................... 315
12.14.1 Drivers ................................................................................................................ 317
The Driver Table and Installing Drivers ........................................................ 318
Example of Installing a Driver ........................................................................ 318
12.14.2 Devices ................................................................................................................ 319
The Device List and Adding Devices ............................................................. 319
Example of Adding Devices ............................................................................ 320
Deleting Devices ................................................................................................ 320
12.14.3 File Descriptors .................................................................................................. 323
File Descriptor Table ......................................................................................... 323
Example of Opening a File ............................................................................... 323
Example of Reading Data from the File ......................................................... 326
Example of Closing a File ................................................................................. 327
Implementing select( ) ...................................................................................... 327
Cache Coherency ............................................................................................... 330
13 Local File Systems ..................................................................................... 335
13.1 Introduction ...................................................................................................................... 335
13.2 File System Monitor ...................................................................................................... 337
Device Insertion Events .................................................................................... 338
XBD Name Mapping Facility .......................................................................... 339
13.3 Virtual Root File System: VRFS ................................................................................... 339
13.4 Highly Reliable File System: HRFS ............................................................................ 341
13.4.1 Configuring VxWorks for HRFS ..................................................................... 341
13.4.2 Configuring HRFS ............................................................................................ 342
13.4.3 Creating an HRFS File System ....................................................................... 343
Overview of HRFS File System Creation ....................................................... 343
HRFS File System Creation Steps ................................................................... 343
13.4.4 HRFS, ATA, and RAM Disk Examples .......................................................... 344
13.4.5 Optimizing HRFS Performance ...................................................................... 349
13.4.6 Transactional Operations and Commit Policies ......................................... 349
Automatic Commit Policy ............................................................................... 349
High-Speed Commit Policy ............................................................................. 350
Mandatory Commits ......................................................................................... 350
Rollbacks ............................................................................................................. 350
Programmatically Initiating Commits ........................................................... 351
13.4.7 File Access Time Stamps .................................................................................. 351
Contents
xvii
13.4.8 Maximum Number of Files and Directories ................................................. 351
13.4.9 Working with Directories ................................................................................. 351
Creating Subdirectories .................................................................................... 352
Removing Subdirectories ................................................................................. 352
Reading Directory Entries ................................................................................ 352
13.4.10 Working with Files ............................................................................................ 352
File I/O Routines ............................................................................................... 352
File Linking and Unlinking ............................................................................. 353
File Permissions ................................................................................................. 353
13.4.11 I/O Control Functions Supported by HRFS ................................................. 353
13.4.12 Crash Recovery and Volume Consistency ..................................................... 354
Crash Recovery .................................................................................................. 354
Consistency Checking ...................................................................................... 354
13.4.13 File Management and Full Devices ................................................................ 355
13.5 MS-DOS-Compatible File System: dosFs .................................................................. 355
13.5.1 Configuring VxWorks for dosFs ..................................................................... 356
13.5.2 Configuring dosFs ............................................................................................ 357
13.5.3 Creating a dosFs File System ........................................................................... 358
Overview of dosFs File System Creation ....................................................... 358
dosFs File System Creation Steps ................................................................... 359
13.5.4 dosFs, ATA Disk, and RAM Disk Examples ................................................. 361
13.5.5 Optimizing dosFs Performance ...................................................................... 365
13.5.6 Working with Volumes and Disks .................................................................. 366
Accessing Volume Configuration Information ............................................. 366
Synchronizing Volumes .................................................................................... 366
13.5.7 Working with Directories ................................................................................. 366
Creating Subdirectories .................................................................................... 366
Removing Subdirectories ................................................................................. 367
Reading Directory Entries ................................................................................ 367
13.5.8 Working with Files ............................................................................................ 367
File I/O Routines ............................................................................................... 367
File Attributes .................................................................................................... 367
13.5.9 Disk Space Allocation Options ........................................................................ 369
Choosing an Allocation Method ..................................................................... 370
Using Cluster Group Allocation ..................................................................... 370
Using Absolutely Contiguous Allocation ...................................................... 370
13.5.10 Crash Recovery and Volume Consistency ..................................................... 372
13.5.11 I/O Control Functions Supported by dosFsLib ............................................ 372
13.5.12 Booting from a Local dosFs File System Using SCSI ................................... 374
13.6 Transaction-Based Reliable File System Support for dosFs: TRFS ....................... 376
VxWorks
Kernel Programmer's Guide, 6.9
xviii
13.6.1 Configuring VxWorks With TRFS ................................................................... 376
13.6.2 Automatic Instantiation of TRFS .................................................................... 376
13.6.3 Formatting a Device for TRFS ......................................................................... 377
13.6.4 Using TRFS in Applications ............................................................................ 378
TRFS Code Examples ....................................................................................... 378
13.7 Raw File System: rawFs ................................................................................................. 379
13.7.1 Configuring VxWorks for rawFs ..................................................................... 379
13.7.2 Creating a rawFs File System .......................................................................... 379
13.7.3 Mounting rawFs Volumes ................................................................................ 381
13.7.4 rawFs File I/O ................................................................................................... 381
13.7.5 I/O Control Functions Supported by rawFsLib ........................................... 382
13.8 CD-ROM File System: cdromFs ................................................................................... 382
13.8.1 Configuring VxWorks for cdromFs ................................................................ 384
13.8.2 Creating and Using cdromFs ........................................................................... 384
13.8.3 I/O Control Functions Supported by cdromFsLib ...................................... 386
13.8.4 Version Numbers ............................................................................................... 387
13.9 Read-Only Memory File System: ROMFS ................................................................. 387
13.9.1 Configuring VxWorks with ROMFS ............................................................... 387
13.9.2 Adding a ROMFS Directory and File Content to VxWorks ........................ 388
13.9.3 Accessing Files in ROMFS ............................................................................... 388
13.9.4 Using ROMFS to Start Applications Automatically .................................... 388
13.10 Target Server File System: TSFS ................................................................................... 389
Socket Support ................................................................................................... 389
Error Handling .................................................................................................. 390
Configuring VxWorks for TSFS Use ............................................................... 390
Security Considerations ................................................................................... 390
Using the TSFS to Boot a Target ...................................................................... 391
14 Flash File System Support: TrueFFS ........................................................ 393
14.1 Introduction ...................................................................................................................... 393
14.2 Overview of Implementation Steps ............................................................................ 394
14.3 Creating a VxWorks System with TrueFFS ................................................................ 396
14.3.1 Selecting an MTD .............................................................................................. 396
14.3.2 Identifying the Socket Driver .......................................................................... 396
14.3.3 Configuring VxWorks with TrueFFS and File System ................................. 397
Including the Core TrueFFS Component ....................................................... 397
Including the MTD Component ...................................................................... 398
Contents
xix
Including the Translation Layer Component ................................................ 398
Including the Socket Driver ............................................................................. 399
Including the XBD Wrapper Component ...................................................... 399
Including File System Components ............................................................... 399
Including Utility Components ........................................................................ 399
14.3.4 Building the System .......................................................................................... 400
14.3.5 Formatting the Flash ......................................................................................... 400
Formatting With sysTffsFormat( ) .................................................................. 400
Formatting With tffsDevFormat( ) .................................................................. 401
14.3.6 Reserving a Region in Flash for a Boot Image .............................................. 402
Reserving a Fallow Region .............................................................................. 403
Writing the Boot Image to Flash ...................................................................... 404
14.3.7 Mounting the Drive .......................................................................................... 405
14.3.8 Creating a File System ...................................................................................... 405
14.3.9 Testing the Drive ............................................................................................... 406
14.4 Using TrueFFS Shell Commands ................................................................................. 406
14.5 Using TrueFFS With HRFS ............................................................................................ 407
14.5.1 TrueFFS With HRFS Code Example ............................................................... 407
14.5.2 TrueFFS With HRFS Shell Command Example ............................................ 408
14.6 Using TrueFFS with dosFs ............................................................................................. 409
15 Network File System: NFS ......................................................................... 411
15.1 Introduction ...................................................................................................................... 411
15.2 Configuring VxWorks With an NFS Client ................................................................ 412
Core NFS Client ................................................................................................. 412
NFS Client All .................................................................................................... 412
NFS v2 Client ..................................................................................................... 413
NFS v3 Client ..................................................................................................... 414
NFS Mount All ................................................................................................... 416
15.3 Setting Up an NFS Client .............................................................................................. 416
15.3.1 Setting the NFS Client Name, User ID, and Group ID ................................ 416
15.3.2 Adding Remote NFS System to Host Table ................................................... 417
15.3.3 Mounting a Remote File System ..................................................................... 417
15.4 Configuring VxWorks With an NFS Server ............................................................... 418
NFS Server .......................................................................................................... 419
NFS server All .................................................................................................... 420
NFS server V2 .................................................................................................... 420
NFS server V3 .................................................................................................... 420
15.5 Exporting NFS File Systems ......................................................................................... 422
VxWorks
Kernel Programmer's Guide, 6.9
xx
Exporting File Systems from a VxWorks System ......................................... 422
Exporting File Systems From a UNIX System .............................................. 423
Exporting File Systems from a Windows System ......................................... 423
15.6 Configuring VxWorks for NFS Debugging ............................................................... 423
16 Kernel Core Dumps .................................................................................... 425
16.1 Introduction ...................................................................................................................... 425
16.2 About Kernel Core Dumps ............................................................................................ 426
Limitations of Core Dumps for VxWorks SMP ............................................. 428
16.3 Configuring VxWorks with Basic Kernel Core Dump Support ............................. 428
Basic Core Dump Components and Parameters .......................................... 428
Optional Components ...................................................................................... 430
16.4 Configuring Persistent Memory-Region Storage ..................................................... 431
16.4.1 Configuring the VxWorks Components ........................................................ 432
About Persistent Memory Uses ...................................................................... 432
Configuring Persistent Memory for Core Dump Use .................................. 433
16.4.2 Verifying Persistent Memory Configuration ................................................. 433
16.4.3 Configuring the 32-Bit Boot Loader .............................................................. 434
16.5 Enabling Core Dump File Compression ..................................................................... 435
16.6 Changing the Areas of Memory Captured by Core Dumps ................................... 436
16.6.1 Including the Kernel Text Section in Core Dumps ....................................... 436
16.6.2 Excluding User Reserved Memory From Core Dumps ............................... 436
16.6.3 Filtering Selected Memory Areas From Core Dumps .................................. 437
16.6.4 Adding Additional Memory Areas to Core Dumps .................................... 437
16.7 Using the Core Dump Hook Routine Manager ......................................................... 437
16.8 Initializing the Kernel Core Dump Facility ............................................................... 438
16.9 Generating Kernel Core Dumps .................................................................................. 439
16.10 Managing Kernel Core Dump Files ............................................................................. 439
16.11 Analyzing Kernel Core Dumps .................................................................................... 442
17 Core Dump Raw Device Interface ............................................................. 443
17.1 Introduction ...................................................................................................................... 443
17.2 Creating Custom Raw Device Storage Support ....................................................... 443
17.3 Coding a Raw Device-Driver Interface ....................................................................... 444
剩余763页未读,继续阅读
210 浏览量
873 浏览量
108 浏览量
175 浏览量
527 浏览量
319 浏览量
135 浏览量
186 浏览量
527 浏览量
weixin_35949050
- 粉丝: 3
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- RomeroHeavy
- kotlin-deep-copy-helper:轻松复制和修改不可变的复杂对象树。 通过序列化,具有杰克逊库
- UnidreamLED.zip
- fansky:饭斯基-第三方饭否客户端
- 易语言学习-WEB客户支持库2.3支持对json解析(支持静态).zip
- 15个家电图标 .sketch素材下载
- nodejs-examples:来自各种Node.js书籍的代码示例
- 好泰州分类信息网站
- HTML-QUIZ-Registration-Form:该存储库包含使用中级HTML标记创建的测验注册表单
- Renaissance
- 疲劳驾驶测试Demo.rar
- qt-读写HID库文件
- Navicat_Premium_15.0.16.rar
- pact-consumer-swift:用于创建协议的Swift ObjeciveC DSL
- RangeMedium
- 中国货源网址站
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功