Anda di halaman 1dari 10

ASSIGNMENT ON RTOS

VxWorks

SUBMITTED BY,
AMALA MARY THOMAS BHIMI M SUKU INDU RAJ KRISHNAPRIYA P N SAFARFAN P K SHAHANAS SALIM K A

REAL TIME OPERATING SYSTEM (RTOS)

A real-time operating system (RTOS) is an operating system (OS) intended to serve real-time application requests. A key characteristic of an RTOS is the level of its consistency concerning the amount of time it takes to accept and complete an application's task; the variability is jitter. A hard real-time operating system has less jitter than a soft real-time operating system. The chief design goal is not high throughput, but rather a guarantee of a soft or hard performance category. An RTOS that can usually or generally meet a deadline is a soft real-time OS, but if it can meet a deadline deterministically it is a hard real-time OS. An RTOS has an advanced algorithm for scheduling. Scheduler flexibility enables a wider, computer-system orchestration of process priorities, but a real-time OS is more frequently dedicated to a narrow set of applications. Key factors in a real-time OS are minimal interrupt latency and minimal thread switching latency; a real-time OS is valued more for how quickly or how predictably it can respond than for the amount of work it can perform in a given period of time.

VXWORKS
VxWorks is a proprietary, real-time operating system developed by Wind River Systems of Alameda, California, USA in 1987. The key features of the current OS are:

Binary, counting, and mutual exclusion semaphores with priority inheritance Error handling framework Fast, flexible inter-process communication including TIPC File system. Full ANSI compliance and enhanced C++ features for exception handling and template support

IPv6 networking stack Local and distributed message queues Memory protection to isolate user applications from the kernel Multitasking kernel with preemptive and round-robin scheduling and fast interrupt response

POSIX PSE52 certified conformance SMP support VxSim simulator Some of these key features are explained below.

Layer Structure

Microkernel Functions: 1. Multitasking

Suspended used primarily for debugging Ready wait for CPU, a single primitive=create+activate Pended blocked, wait t time for recourses. After t - Error. Delay asleep for t time, after t goes to ready state. On a context switch, a tasks context is saved in TCB. All code executes in a single common space. Memory isnt saved. 2. Scheduling i. Priority-based preemptive scheduling:a. Each task has priority (from 0 - highest to 255 - lowest). Each priority has its own queue. b. If two tasks are in the ready state, a lower priority task would be pre-empted by one of a higher priority.

ii.

Round-robin scheduling:After time slice for a task expires, another task with the same priority will execute during the given time slice.

iii.

Preemption locks:These locks prevent task context switching, but do not prevent interrupt handling.

3. Interrupt Service Code Via interrupts, the system is informed of external events. Interrupt Service Routines (ISRs) run outside any task context. Interrupt handling involves no task context switch. Limitations of ISR: a) All ISRs share the same stack b) ISR has no context that can be suspended c) Cannot take the semaphore, but can give the semaphores, releasing any task waiting on them. d) Cannot perform I/O through drivers except pipe. 4. Shared Code and Reentrancy Shared Code - a single copy of code executed by multiple tasks.

Shared Code must be reentrant. A subroutine is reentrant if a single copy of the routine can be called simultaneously from several task contexts without conflict. Reentrancy Techniques: Dynamic Stack Variables Global and Static Variables Guarded by Semaphores Task Variables

Dynamic Stack Variables

Guarded Global and Static Variables Mutual-exclusion mechanism - only one task at a time critical section of the code. Task Variables Four byte variables are added to the task context block (TCB). can be in a

5. Intertask Communications Types of Intertask Communications: Shared Data Message Queue Pipes - Virtual I/0 Network Intertask Communication Sockets

Remote Procedure Call

Semaphore - mechanism for mutual exclusion and intertask communication.

Binary Semaphore

Counting Semaphore a) Every time semaphore is given count ++ b) Every time is semaphore is taken count -c) If count=0, task that tried to take semaphore is blocked d) If semaphore is given and task is blocked, task is unblocked Is semaphore is given and no tasks are blocked, count ++ Special Semaphore Option (Not in POSIX) Timeout Time the task is willing to wait (time in ticks) in pended state. If time > timeout, ERROR occurs.

6. Intertask Communication, Message Queue Allows a variable number of messages to be queued Any task or ISR can send a message to a queue. Multiple tasks can send and receive from the same message queue.

Timeout Parameter: Send message: how long to wait for buffer space to place message. Receive message: how long to wait to obtain message.

Applications for VxWorks Flight simulators Radio and optical telescopes Navigation systems Deep sea instrumentation Traffic control systems Modems Printers Digital cameras Hand-held computing devices Routers, switches, and other network devices Any systems where rigid time requirement have been placed on the operation of a processor or the flow of the data.