Lesson-9: Basic RTOS Functions in Vxworks

Lesson-9: Basic RTOS Functions in Vxworks

REAL TIME OPERATING SYSTEM PROGRAMMING-I: C/OS-II and VxWorks Lesson-9: Basic RTOS Functions in VxWorks 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 1 Raj Kamal, Publs.: McGraw-Hill Education 1. VxWorks Features 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 2 Raj Kamal, Publs.: McGraw-Hill Education WindRiver VxWorks • High-performance, Unix-like, multitasking Environment scalable and hierarchical RTOS • Host and target based development approach • Supports ‘Device Software Optimization ─ a new methodology that enables development and running of device software faster, better and more reliably 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 3 Raj Kamal, Publs.: McGraw-Hill Education VxWorks RTOS Kernel… • VxWorks 6.x processor abstraction layer • The layer enables application design for new versions later by just changing the layer-hardware interface • Supports advanced processor architectures─ ARM, ColdFire, MIPS, Intel, SuperH,… 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 4 Raj Kamal, Publs.: McGraw-Hill Education Presently Needed RTOS Features Secure, intelligent, connected devices is constantly expanding Embedded devices becoming more complex and use Complex Processors Device Software Optimisation Internet connectivity allows new levels of remote management but also calls for increased levels of security. 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 5 Raj Kamal, Publs.: McGraw-Hill Education Wind River VxWorks Platforms 6.9 Latest Version comprehensive multi- core processor support, including asymmetric multiprocessing (AMP) and symmetric multiprocessing (SMP) operating system configurations as well as hardware optimized multi-core acceleration capabilities 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 6 Raj Kamal, Publs.: McGraw-Hill Education VxWorks RTOS Kernel… • Hard real time applications • Supports kernel mode execution of tasks • Supports open source Linux and TIPC (transparent inter process communication) protocol 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 7 Raj Kamal, Publs.: McGraw-Hill Education VxWorks RTOS Kernel… • Provides for the preemption points at kernel • Provides preemptive as well as round robin scheduling, • Support POSIX standard asynchronous IOs • Support UNIX standard buffered I/Os 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 8 Raj Kamal, Publs.: McGraw-Hill Education VxWorks RTOS Kernel… • PTTS 1.1 (Since Dec. 2007) • IPCs in TIPC for network and clustered system environment • POSIX 1003.1b standard IPCs and interfaces additional availability • Separate context for tasks and ISRs [Each task has a separate TCB, while ISRs a common stack] 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 9 Raj Kamal, Publs.: McGraw-Hill Education VxWorks RTOS Kernel… Schedules the ISRs separately and has special functions for interrupt handling Watchdog timers Virtual I/O devices including the pipes and sockets (Sections 9.14 and 9.15) Virtual Memory Management functions 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 10 Raj Kamal, Publs.: McGraw-Hill Education VxWorks RTOS Kernel… Power management functions that enhance the ability to control power consumption Automatic detection and reporting of common memory and other errors Interconnect functions that support large number of protocols APIs for IPv4/IPv6 dual mode stack 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 11 Raj Kamal, Publs.: McGraw-Hill Education Host-Target Development Approach • Host Windows, Linux or Unix for Embedded Development and cross compiled for target system processor RTOS ROM resident code downloaded to the using TCP/IP or serial port to a target board Target has no virtual memory support and needed kernel functions are at the target ROM 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 12 Raj Kamal, Publs.: McGraw-Hill Education Scalability Scalable OS – only needed OS functions become part of the application codes Configuration file includes the user definitions for the needed IPC functions needed 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 13 Raj Kamal, Publs.: McGraw-Hill Education Hierarchical RTOS kernel extendibility and interfaces hierarchy includes timers, signals, TCP/IP Sockets, queuing functions library, NFS, RPCs, Berkeley Port and Sockets, Pipes, Unix compatible loader, language interpreter, shell, debugging tools and linking loader for Unix. 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 14 Raj Kamal, Publs.: McGraw-Hill Education Protected Environment • Protection features – for example, if a task is expecting a message from another task, which is being deleted by using the task-delete function, then RTOS inhibits the deletion • No priority inversion problem─ the task gets an inherited priority when option of priority inheritance selected 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 15 Raj Kamal, Publs.: McGraw-Hill Education Header Files • VxWorks.h – header file • kernelLib.h – kernel library functions header file • taskLib.h – tasks library functions header file • sysLib.h system library functions header file 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 16 Raj Kamal, Publs.: McGraw-Hill Education VxWorks Basic Functions • System Level – OS initiate, start, system timer clock rate set, ISR enter and exit, enable and disable • Task Service Functions – initiate, resume, activate, run, suspend, (now or after delay) • Task control functions 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 17 Raj Kamal, Publs.: McGraw-Hill Education VxWorks Basic Functions… • IPCs – Semaphore, Queue and Pipes, POSIX IPCs • No Mailbox • Queue permit array of messages • Network Functions • IO Functions 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 18 Raj Kamal, Publs.: McGraw-Hill Education 2. Signal (Software interrupt from task) Handling 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 19 Raj Kamal, Publs.: McGraw-Hill Education Signal • IPC signal used for exception handling or handling software interrupt event • Signal-servicing routine─ a C function, which executes on occurrence of an interrupt or exception. • Signal connect function connects the function with an interrupt vector 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 20 Raj Kamal, Publs.: McGraw-Hill Education 3. Semaphore Functions 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 21 Raj Kamal, Publs.: McGraw-Hill Education Semaphore functions for Synchronization • event signal flag, • mutually exclusive access using resource key (mutex) and • counting mechanism using three type of semaphores in the tasks and ISRs • P-V semaphore functions when POSIX library included 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 22 Raj Kamal, Publs.: McGraw-Hill Education Two ways in which a pending task among the pending tasks unblock • Provides for– (a) as per task priority (b) as a FIFO, when accepting or taking an IPC 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 23 Raj Kamal, Publs.: McGraw-Hill Education 4. Queues Functions 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 24 Raj Kamal, Publs.: McGraw-Hill Education Queue… • Instead of queuing the message pointers in C/OS-II , provides for queuing of the messages. • Queues can be used for priority posting of message using post front as in C/OS-II 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 25 Raj Kamal, Publs.: McGraw-Hill Education Queue • Provides for two ways in which a pending task among the pending tasks can unblock – (a) as per task priority (b) as a FIFO, when accepting or taking an IPC 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 26 Raj Kamal, Publs.: McGraw-Hill Education 5. Virtual device Functions 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 27 Raj Kamal, Publs.: McGraw-Hill Education 5. Virtual device Functions Pipe Drivers for inter-process communications as an I/O virtual device Network-transparent sockets. Network drivers for shared memory and Ethernet. RAM "disk" drivers for memory resident files files 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 28 Raj Kamal, Publs.: McGraw-Hill Education 6. Task Service Functions 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 29 Raj Kamal, Publs.: McGraw-Hill Education Task functions • Task creation and activation distinct states • Functions for the task creating, running, waiting, suspending (inhibiting task-execution) and resuming, spawning (creating followed by activating), task-pending cum suspending and pending cum suspension with timeout functions 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 30 Raj Kamal, Publs.: McGraw-Hill Education 7. VxWorks Functions naming Basics 2015 Chapter-11 L09: "Embedded Systems - Architecture, Programming and Design", 31 Raj Kamal,

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    36 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us