Download - Vx Works and Interrupt Service Routines
-
7/31/2019 Vx Works and Interrupt Service Routines
1/22
-
7/31/2019 Vx Works and Interrupt Service Routines
2/22
VxWorks Facilities
-
7/31/2019 Vx Works and Interrupt Service Routines
3/22
Introduction
developed by Wind River Systems, is a RealTime Operating System (RTOS) used to developreal-time applications for embedded systems.
VxWorks is available for Windows and UNIX
platforms. It provides a Graphical User Interface (GUI) for
application development
It provides high performance for critical tasks,
such as scheduling, memory allocation,interrupt handling etc.
-
7/31/2019 Vx Works and Interrupt Service Routines
4/22
The VxWorks Architecture
VxWorks RTOS runs on client-server architecture. main
components-
Microkernel: (aka wind)
necessary to limit kernel size
because of the memory
constraints in ES.
VxWorks libraries: Provide the
functions necessary to use the
kernel services.Modules: (aka Board Support
Packages (BSPs)) Enable VxWorks
to accommodate simple and
complex ES.
-
7/31/2019 Vx Works and Interrupt Service Routines
5/22
VxWorks Facilities
High-Performance Real-time Kernel Facilities POSIX Compatibility
I/O System
Local File Systems
Shared-Memory Objects Virtual Memory
C++ Development Support
Utility Libraries
Performance Evaluation Tools Target Agent
Network Facilities
-
7/31/2019 Vx Works and Interrupt Service Routines
6/22
High-Performance Real-time
Kernel Facilities
Multitasking facilities(real time apps haveindependent tasks, each having own thread
and system resources)Multitasking kernel ( wind) uses interrupt-
driven, priority-based task scheduling
Inter-task communicationsfacilities(allowtasks to coordinate and synchronize)the wind kernel also supplies message queues,
pipes, sockets, and signals
-
7/31/2019 Vx Works and Interrupt Service Routines
7/22
POSIX CompatibilityPOSIX -the Portable Operating System Interface
is a set of standards under development byrepresentatives of the software community, working
under an ISO/IEEE charter, to support application
portability
All POSIX 1003.1b interfaces are available in Vxworks. asynchronous I/O
semaphores
message queues
memory management
queued signals
scheduling
clocks and timers
-
7/31/2019 Vx Works and Interrupt Service Routines
8/22
I/O System
Provides uniform device-independent access to manykinds of devices: (basic I/O routines: creat( ),remove( ), open( ), close( ), read( ), write( ), andioctl( ). Higher-level I/O routines printf( ) and scanf( )routines are also provided. )
A fast and flexible ANSI C-compatible routines (suchas fopen( ), fclose( ), fread( ), fwrite( ), getc( ), andputc( ) )
Includes POSIX-compliant asynchronous I/O: a lib. ofroutines performing i/o operations with other taskactivities concurrently.
includes device drivers for serial communication,disks, RAM disks, tape devices etc
-
7/31/2019 Vx Works and Interrupt Service Routines
9/22
Local File Systems
Includes several local file systems for use with blockdevices (disks)
devices all use a standard interface
Several different file systems on single VxWorks systempossible even at same time.
MS-DOS Compatible File System: dosFs
RT-11 Compatible File System: rt11Fs
Raw Disk File System: rawFs
SCSI Sequential File System: tapeFs
cdRomFs Alternative File Systems
-
7/31/2019 Vx Works and Interrupt Service Routines
10/22
C++ Development Support
The iostream library and the standard templatelibrary
VxWorks Wrapper Class library
Tools.h++ library
Virtual Memory VxWorks provides both bundled and unbundled (VxVMI)
virtual memory support with MMU, including the ability
to make portions of memory read-only. Bundled virtual memory provides the ability to mark buffers
noncacheable.
Unbundled virtual memory provides the ability to make textsegments and the exception vector table read-only.
-
7/31/2019 Vx Works and Interrupt Service Routines
11/22
Shared-Memory Objectsused for communication and synchronization
between tasks on different CPUs.
Shared semaphores can be used to synchronize
tasks on different CPUs as well as provide mutualexclusion to shared data structures.
Shared message queues allow tasks on multiple
processors to exchange messages.
Shared memory management is available to
allocate common data buffers for tasks on different
processors.
-
7/31/2019 Vx Works and Interrupt Service Routines
12/22
Utility Libraries
set of subroutine libraries, reduces both developmenttime and memory requirements
Interrupt Handling Support : hardware interrupts andsoftware traps handled.
Watchdog Timers (A watchdog facility allows callersto schedule execution of their own routines afterspecified time delays. )
Message Logging (A simple message logging facility
allows applications to send error or status messagesto a logging task, which then formats and outputsthe messages to a system-wide logging device )
-
7/31/2019 Vx Works and Interrupt Service Routines
13/22
CONT..
Memory Allocation (VxWorks supplies a memorymanagement facility useful for dynamically
allocating, freeing, and reallocating blocks of
memory from a memory pool. )
ANSI C(The ANSI C specification includes thefollowing libraries: assert, ctype, errno, float, limits,
locale, math, setjmp, signal, stdarg, stdio, stddef,
stdlib, string, and time.).
Other types are Linear and Ring Buffer Manipulations,Linked-List Manipulations.
-
7/31/2019 Vx Works and Interrupt Service Routines
14/22
Performance Evaluation Tools
To understand and optimize the performanceof a real-time system
VxWorks also provides the spy utility, whichprovides CPU utilization information for eachtask: the CPU time consumed, the time spent atinterrupt level, and the amount of idle time.
-
7/31/2019 Vx Works and Interrupt Service Routines
15/22
Target Agent
o The target agent follows the WDB (Wind DeBug)protocol
o At the target side, target runs as the VxWorks tasktWdbTask.
o The target server sends debugging requests to thetarget agent.
o The debugging requests often result in the targetagent controlling or manipulating other tasks in the
system.o The target server and agent communicate using the
network.
-
7/31/2019 Vx Works and Interrupt Service Routines
16/22
-
7/31/2019 Vx Works and Interrupt Service Routines
17/22
Network Facilities
VxWorks provides "transparent" access to otherVxWorks and TCP/IP-networked systems.
MUX interface (supporting advanced features such asmulticasting, polled-mode Ethernet, and zero-copytransmission).
Sockets-compliant programming interface, remoteprocedure calls (RPC), SNMP (optional), remote file access(including NFS client and server facilities and a non-NFS facilityutilizing RSH, FTP, or TFTP).
All VxWorks network facilities comply with standard Internetprotocols.
-
7/31/2019 Vx Works and Interrupt Service Routines
18/22
Interrupt Service Routines Interrupt routines in an RTOS must adhere to two
rules:
Mustnt call RTOS functions that might block the caller
-Violating this rule may affect response time and
may even cause deadlock. May not call any RTOS function that might cause
RTOS to switch tasks unless the RTOS knows that aninterrupt routine, and not a task is running.
-RTOS uses various mechanisms to learn thatinterrupt routine is working. Violation may allow RTOS toswitch to other task and the ISR may not complete fora long time, thus greatly affecting response time
-
7/31/2019 Vx Works and Interrupt Service Routines
19/22
How Interrupt routine should work?
1. The interrupt routine interrupts the lower priority task2. Calls the RTOS to write a message to the mail box(legal under rule 1)3. When the interrupt routine exits, RTOS guides the microprocessorto continue with the original task or start a higher priority task.
-
7/31/2019 Vx Works and Interrupt Service Routines
20/22
What would really happen??
1. The higher priority task is blocked on the mailbox2. As soon as the interrupt routine writes to the mailbox, RTOS
unblocks the higher priority task.3. The task that was running (ISR), is no longer the highest priorityready-to-run task.4. RTOS switches to the higher priority task, ISR couldnt be completeduntil later
-
7/31/2019 Vx Works and Interrupt Service Routines
21/22
How interrupt routines do work?
1. RTOS intercepts all interrupts (start time) and then call the interrupt
routine.2. After routine writes to the mailbox, the RTOS knows to return to the
routine and not to any unblocked higher priority task.3. After the ISR is over, RTOS gets the control again and decide thenext task
-
7/31/2019 Vx Works and Interrupt Service Routines
22/22
THANK YOU