1.1. POSIX interface
POSIX (portable operating system interface) is a standard for software groups under ISO / IEEE. The purpose of this standard is to achieve source code grade transplantation of multi-operating system applications. A set of interfaces are defined for the service provided by the real-time operating system (POSIX standard 1003.1b, previously referred to as 1003.4). Using these interface programming will make the application to port from one operating system to another operating system.
The POSIX interface includes:
M asynchronous I / O
M signal amount
M message
M Memory Management
M signal
M dispatched
m clock
1.2. I / O system
VxWorks's I / O system provides a unified access mechanism for multiple input and output devices. You can call basic I / O functions: Creat (), remove (), open (), close (), read (), write (), and ioctl (); can also call high-level I / O functions, such as Printf (), Scanf ().
VxWorks also provides buffer input / STDIO, including ANSI-C compatible functions, such as fopen (), fclose (), FREAD (), FWRITE (), Getc (), and PUTC (). In many cases, these functions increase the performance of the input and output.
The I / O system of VxWorks also includes POSIX-compatible asynchronous input and output: input and task other action functions simultaneous functions.
VxWorks contains drivers for the following devices: serial communication, disks, RAM disks, SCSI tapes, pipelines for task communication, and network devices. If necessary, app developers can easily write drivers for other devices, join VxWorks.
The I / O system of VxWorks allows the driver to fully control how to execute user requests. The driver can easily implement different protocols, unique device-specific functions, even different file systems, uninform with the input and output systems. VxWorks provides some high-level packages to make the driver easy to implement public device protocols and file systems.
1.3. Local file system
VxWorks contains several local file systems to use block devices (disks). These devices use standard interfaces to facilitate hooks on the file system. The local file system contains the SCSI tape file system and the CD-ROM file system. The VxWorks input / output architecture enables the VxWorks system to have multiple different file systems at the same time.
1.3.1. MS-DOS compatible file system
VxWorks offers a DOSFS file system that is compatible with the MS-DOS file system. DOSFS provides considerable elasticity in order to adapt to various needs of real-time applications. The main features are as follows:
The M-tree file directory structure allows you to create any multiple files on a volume.
m You can specify the continuous storage of the file, and the continuously stored files can improve performance, while non-continuously stored files can take full advantage of disk space.
m is compatible with the currently used access media, and the disk created under the DOSFS file system can be interacting with disk created with MS-DOS Personal Computer. The hard drive under MS-DOS can be identified correctly configured DOSFS file system.
M file names are case sensitive, and the length of the file name is unrestricted (the file name length under the MS-DOS file system is set to 8 characters file extensions).
DOSFS is implemented in DOSFSLIB for services for file-oriented device drivers.
1.3.2. RT-11 compatible file system RT11FS
The RT11FS file system is compatible with the RT-11 operating system. The file system has been used in real time because all files under the file system are continuously stored. However, it lacks a tree file organizational structure, and a tree file organizational structure is particularly useful to a large-capacity disk. At the same time, dull continuous storage spatial distribution can result in a large number of disk fragments. Therefore, DOSFS is better than RT11FS. The RT11FS file system implemented by VxWorks can use byte addressing to random access. Each open file has a buffer memory to optimize read and write to the file.
RT11FS is implemented in RT11FSLIB for services to file-oriented device drivers.
1.3.3. Naked saucer file system
VxWorks offers a simple bare disc file system RAWFS. Rawfs will use the entire disk as a big file. By specifying byte offset RAWFS, you can read and write a part of the disk and make a simple buffer. The RAWFS has the advantage of space and speed when simply, low-level disk input and output operations.
Rawfs is implemented in Rawfslib for services to file-oriented device drivers.
1.3.4. SCSC sequential file system: TAPFS
VxWorks provides TAPFS file systems for tape devices that do not use standard files and directory structures. The tape is like a bare disk as a big file. The upper layer is responsible for organizing data in this large file.
TAPFS is implemented in TAPFSLIB for services for file-oriented device drivers.
1.3.5. CDROM file system
VxWorks provides CDROMFS in order to make the app read and write CDROM devices formatted by ISO9660 file system standard. After initializing the CDROMFS file system, hook CDROMFS to a CDROM device, you can read CDROM with POSIX standard I / O.
1.3.6. Alternative file system
Under VxWorks, the file system is not tightly driven by a particular device or device. The device can be attached to any file system. You can provide your own file system to use standard devices in accordance with the interface standards between the input and output systems of the input and output systems in the file system, driver, and VxWorks.
1.4. Virtual memory
VxWorks provides virtual memory support for boards with memory management units. Binding virtual memory support enables partial memory without buffering, which is very useful to share memory between multiprocessors or use DMA transmission.
Non-bound virtual memory support is provided by optional components VxVMI. VxVMI allows applications to create text segments and readable exception menus and contain a set of functions to manage their virtual memory scenarios.
1.5. Share memory object
The following shared memory object (optional component VXMP is provided) is used to communicate and synchronize between tasks on different processors.
l The shared semaphore is used to synchronize the task on different processors, and can also be used as a mutually exclusive access to the shared data structure.
l The shared message is used to transfer messages between tasks on different processors.
l Shared Memory Management is to assign public memory spaces for tasks on different processors.
1.6. Tools running on the target
In the Tornado development system, install and perform a complete set of development tools on the host, see Tornado user guidance. And the shell, symbol table, and module on the target machine can also be configured into the VxWorks system, such as creating dynamic configured VxWorks running systems.
1.7. C development support
VxWorks supports C development, Tornado with the GNU's C compiler. The Tornado compiler provides reusable exception handling. Tornado contains a new version of the Iostream library and SGI standard template libraries. Tornado's interactive development tool debugger, housing, and progressive module loading tools contain support for C .
And you can purchase the component WIND basic class. The Wind foundation class contains the following C library.
VxWorks packaging class
Rogue Wave Tool.h Library 1.8. Tool Library
VxWorks provides a subsidiary of common uses for application developers. These functions are organized as the subditional library as described below. We hope that you use these subunies as much as possible during the development process. Using these libraries can reduce the development time and reduce the memory requirements of the application.
1.9. Interrupt Process Support
VxWorks provides functions that handle hardware interrupts and software traps, not necessarily demanding assembly language. VxWorks have functions that connect C functions to hardware interrupt vectors and handling processor interrupt levels.
1.10. Watchdog timer
The timer allows the user to repeat custom C functions after specifying the time interval. When the specified time interval passes, the timeout function is called in the interrupt level of the system clock until the timer is canceled. The timer mechanism is completely different from the kernel's delay mechanism.
1.11. Message log
VxWorks provides a simple message log mechanism that allows applications to send errors and status messages to a dedicated log task, this task formats the message and outputs the log equipment in the system (such as to system console, disk, memory) . The message log mechanism can be used in task level or interrupt level.
1.12. Memory Allocation
VxWorks provides a memory management mechanism. Memory dynamically assignment, release, reassign a memory in the memory pool. The memory management solution is a universal program that allows VxWorks to manage multiple separate memory pools.
1.13. String formatting and scanning
VxWorks contains a complete string formatted and scanned ANSI-C function set. Implement Prinf () / scanf () based on formatted codec and associated functions.
1.14. Linear and ring buffer operation
The BLIB library contains a copy, fill, comparison, and other buffer operation functions, which are optimized at execution speed. The RingLib library contains commonly used management advanced first ring buffer functions, and allows a read memory task and a write memory task "simultaneously" access memory instead without interrupt memory access.
1.15. Link table operation
The LSTLIB library contains functions for creating and all operational double-linked lists.
1.16. ANSI C library
VxWorks provides all C libraries specified by ANSI X3.159-1989. ANSI C defines the following libraries: Assert, CType, Errno, Float, Limits, Locale, Math, Setjmp, Signal, Stdarg, Stdio, Stddef, Stdlib, String, and Time.
The header file float.h, limiteds.h, errno.h, and stddef.h give the declaration and definitions of ANSI C. The commonly used libraries are listed below:
ANSICTYPE character operates a library.
ANSIMATH Triangle function, index function, logarithmic function.
ANSISetJMP implements a library of remote transfer.
ANSISTDARG traverses the list of non-fixed parameters.
ANSISTDIO Enter the output flow operating function.
ANSISTDLIB includes many types of functions, like type conversions, memory allocations, and random number generation functions.
SIGLIB signal operation function.
1.17. Performance estimation
The performance of VxWorks or applications is very useful for the performance of understanding and optimizing real-time systems. VxWorks provides a lot of timing mechanisms to help estimate the performance of real-time systems.
The VxWorks timer can make a timing of the execution of any functions. Because the system clock interrupts too slow and cannot provide a quick execution function to provide a necessary time accuracy. A set of functions can be repeated for a set of functions until the execution time is within a reasonable accuracy range. See Timexlib for details on the implementation of the timing.
VxWorks provides a Spy tool. The SPY tool provides the CPU usage time of each task, in the interrupt level CPU usage time, idle time. Time is displayed in a percentage or in milliseconds. See SPYLIB for details on SPY Tools.
Monitoring the VxWorks system features more powerful tools are WindView. See WindView User Guide for details. 1.18. Target machine agent
The target agent complies with the WDB protocol, allows Tornado development tools and VxWorks target connections. The target agent is run in the form of a TwDBTask task. The Tornado target server sends a debug request to the target machine agent. The target agent controls and manipulates other tasks in the VxWorks system based on the debug request information.
By default, the target agent and server communicate over network. However, you can take advantage of other available communication paths. See Tornado user guidance on the default configuration and selectable configuration details.
1.19. Board support package
Syslib and sysalib are associated with the target. These libraries are the key to VxWorks portable. They provide a consistent software interface for hardware features of all boards. Mainly includes hardware initialization, interrupt processing, and trigger, hardware clock management, local memory space, and bus memory space mapping, memory arrangement, etc.
The board support package (BSP) contains launching ROM and other startup methods. Most of them import the running image from the development host.
1.20. VxWorks Simulator
VxWorks Simulator, Vxsim is a program for analog VxWorks target, used as prototypes and test environments. Integrated VXSIM allows you to run a simulator. The optional VXSIM adds network support, allowing the emulator to communicate with the Internet address and host communication using the network tool (other nodes on the network).
Vxsim is a very important solution for VxWorks. In many cases, VxSim has a consistent function with the real VxWorks system running on the remote target. You can link to applications, re-editing the VxWorks core, just like other VxWorks cross-platform development environments. All Tornado development tools apply the same to VXSIM.
VxSim is different from VxWorks running on the target: Vxsim running on the host is a process as a host. Because the code is in the host's own CPU architecture, VXSIM cannot simulate the instruction. Because you cannot interact with the hardware of the target, VXSIM is not suitable for analog development device drivers. However, the task schedule of VxWorks is implemented in the VXSIM process, which is a true priority-based preemptive task schedule. This means that the VxWorks application written in portable means can be conveniently transplant on the VxSIM and VxWorks target if the hardware is not associated or rarely associated.
1.21. Customer Service
(slightly)
2. OS foundation
2.1. Introduction
Modern real-time operating systems are concepts based on multitasking and tasks. Multitasking allows real-time applications to be designed into multiple mutual independent tasks, each task has its own execution clues and system resource sets; Task communication allows tasks to coordinate their actions by synchronizing and communicating. In VxWorks, there is a fast semaphore mechanism, messages, and pipelines, and network transparent transmission sockets.
Another important mechanism in the real-time system is interrupt processing. Since the interrupt is a common mechanism for notifying the system's external events, in order to quickly respond to interrupts, VxWorks's interrupt service runs in a special operating environment, different from the task's operating environment.
This chapter focuses on multi-tasking kernel, task mechanism, task communication, interrupt processing mechanism, the core of these VxWorks operating environments.
2.2. Wind feature and POSIX feature
The POSIX standard extension defines a set of interfaces for real-time kernel. In order to increase the portability of the application, the VxWorks kernel, including the POSIX interface and VxWorks specific interface.
This manual uses a Wind qualifier to identify unique features of the VxWorks kernel WIND design. For example, there is a Wind session and POSIX semaphore in the corresponding chapter.
2.3. Task
It is necessary to design the application into multiple independent, but the procedures that cooperate with each other are necessary. Each executable program is called a task. In VxWorks,
Tasks have direct and shared access rights to most system resources. At the same time, it maintains an independent operational environment that sufficient control task to perform clues.