Sie sind auf Seite 1von 22

EMBEDDED SYSTEM DESIGN

VxWorks Facilities

Interrupt Service Routines


TANVI SHARMA ME-IT- 2nd Sem (11-696)

VxWorks Facilities

Introduction
developed

by Wind River Systems, is a Real Time Operating System (RTOS) used to develop real-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.

The VxWorks Architecture


VxWorks RTOS runs on clientserver architecture. main componentsMicrokernel: (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.

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

High-Performance Real-time Kernel Facilities


Multitasking

facilities (real time apps have independent tasks, each having own thread and system resources) Multitasking kernel ( wind) uses interruptdriven, priority-based task scheduling Inter-task communications facilities (allow tasks to coordinate and synchronize) the wind kernel also supplies message queues, pipes, sockets, and signals

POSIX Compatibility

POSIX -the Portable Operating System Interface

is a set of standards under development by representatives 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

I/O System

Provides uniform device-independent access to many kinds of devices: (basic I/O routines: creat( ), remove( ), open( ), close( ), read( ), write( ), and ioctl( ). Higher-level I/O routines printf( ) and scanf( ) routines are also provided. ) A fast and flexible ANSI C-compatible routines (such as fopen( ), fclose( ), fread( ), fwrite( ), getc( ), and putc( ) ) Includes POSIX-compliant asynchronous I/O: a lib. of routines performing i/o operations with other task activities concurrently. includes device drivers for serial communication, disks, RAM disks, tape devices etc

Local File Systems

Includes several local le systems for use with block devices (disks) devices all use a standard interface Several different file systems on single VxWorks system possible 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

C++ Development Support


The

iostream library and the standard template library 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 text segments and the exception vector table read-only.

Shared-Memory Objects
used

for communication and synchronization between tasks on different CPUs. semaphores can be used to synchronize tasks on different CPUs as well as provide mutual exclusion to shared data structures. message queues allow tasks on multiple processors to exchange messages. memory management is available to allocate common data buffers for tasks on different processors.

Shared

Shared

Shared

Utility Libraries
set

of subroutine libraries, reduces both development time and memory requirements Handling Support : hardware interrupts and software traps handled.

Interrupt

Watchdog

Timers (A watchdog facility allows callers to schedule execution of their own routines after specified time delays. ) Message Logging (A simple message logging facility allows applications to send error or status messages to a logging task, which then formats and outputs the messages to a system-wide logging device )

CONT..

Memory Allocation (VxWorks supplies a memory management facility useful for dynamically allocating, freeing, and reallocating blocks of memory from a memory pool. ) ANSI C (The ANSI C specication includes the following libraries: assert, ctype, errno, oat, limits, locale, math, setjmp, signal, stdarg, stdio, stddef, stdlib, string, and time.). Other types are Linear and Ring Buffer Manipulations, Linked-List Manipulations.

Performance Evaluation Tools

To understand and optimize the performance of a real-time system VxWorks also provides the spy utility, which provides CPU utilization information for each task: the CPU time consumed, the time spent at interrupt level, and the amount of idle time.

Target Agent
o The target agent follows the WDB (Wind DeBug) protocol o At the target side, target runs as the VxWorks task tWdbTask. o The target server sends debugging requests to the target agent. o The debugging requests often result in the target agent controlling or manipulating other tasks in the system. o The target server and agent communicate using the network.

Network Facilities

VxWorks provides "transparent" access to other VxWorks and TCP/IP-networked systems. MUX interface (supporting advanced features such as multicasting, polled-mode Ethernet, and zero-copy transmission). Sockets-compliant programming interface, remote procedure calls (RPC), SNMP (optional), remote file access (including NFS client and server facilities and a non-NFS facility utilizing RSH, FTP, or TFTP). All VxWorks network facilities comply with standard Internet protocols.

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 an interrupt routine, and not a task is running. -RTOS uses various mechanisms to learn that interrupt routine is working. Violation may allow RTOS to switch to other task and the ISR may not complete for a long time, thus greatly affecting response time

How Interrupt routine should work?

1. The interrupt routine interrupts the lower priority task 2. Calls the RTOS to write a message to the mail box (legal under rule 1) 3. When the interrupt routine exits, RTOS guides the microprocessor to continue with the original task or start a higher priority task.

What would really happen??

1. The higher priority task is blocked on the mailbox 2. 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 priority ready-to-run task. 4. RTOS switches to the higher priority task, ISR couldnt be completed until later

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 the next task

THANK YOU

Das könnte Ihnen auch gefallen