Você está na página 1de 12

On The Move

Migrating from One RTOS to Another

from Embedded Software: The Works 2005 Mentor Graphics Corporation

Reasons for Migration


RTOS availability for new chip architecture Customer demands Adherence to standards Change in technical requirements Change in commercial business model

from Embedded Software: The Works 2005 Mentor Graphics Corporation

Migration Issues
How can migration of code be managed? What about migration of skills? What preparations can be made for this inevitable migration?

from Embedded Software: The Works 2005 Mentor Graphics Corporation

Code Migration
Moving code from using one API to another May be done by hand Difficult will vary
similar APIs make it easier richer target API is a benefit

from Embedded Software: The Works 2005 Mentor Graphics Corporation

Wrappers
Application
old_rtos_call_1(); old_rtos_call_3(); old_rtos_call_157();

Wrapper
Service #1
new_rtos_call_a();

RTOS

a
Service #3
new_rtos_call_c(); new_rtos_call_d();

c Service Call d Library

Service #157
new_rtos_call_x();

from Embedded Software: The Works 2005 Mentor Graphics Corporation

Wrapper Strategies
Map an old RTOS API onto a new one Design a neutral API and implement a wrapper for each selected RTOS Use a wrapper to implement a standard API on a proprietary RTOS

from Embedded Software: The Works 2005 Mentor Graphics Corporation

Wrapper Implementation
Several approaches:
calls to underlying RTOS
may be optimized to jumps

C language #define macros C++ classes


classes for RTOS objects application-oriented classes which hide RTOS usage

from Embedded Software: The Works 2005 Mentor Graphics Corporation

Wrapper Overheads
Some time/memory overhead
except for pure macro approach

Call-based approach carries call/return sequence time overhead


may be optimized by using jumps memory minimized by using a library

New RTOS may be more efficient


so overheads do not have an impact
from Embedded Software: The Works 2005 Mentor Graphics Corporation

Wrapper Challenges
What kind of task identifier is used?
name, number, pointer

What about priorities?


how many? what mapping? what direction? start at 0 or 1?

How are other facilities implemented?


from Embedded Software: The Works 2005 Mentor Graphics Corporation

API Availability
Application code with calls to Old RTOS Application code with calls to New and Old RTOS wrapper New RTOS [3] New RTOS [4] Application code with calls to New RTOS

Application code with calls to Old RTOS

wrapper Old RTOS [1] New RTOS [2]

Time
from Embedded Software: The Works 2005 Mentor Graphics Corporation

Debug-Driven RTOS Migration


Ad a
Commercial RTOS

pt

Port No debug Custom RTOS Custom RTOS Commercial RTOS

[1]

[2]

[3]
from Embedded Software: The Works 2005 Mentor Graphics Corporation

RTOS Standards
POSIX
UNIX standard

micro-ITRON
very strong in Japan

OSEK/VDX
initially automotive/transportation

Java
language or API?
from Embedded Software: The Works 2005 Mentor Graphics Corporation

Você também pode gostar