Transcript OSEK OS

Mar.11. 2009
OSEK/VDK
Woo Dong Kyun
Contents
1.OSEK OS Introduce
2.OSEK OS Processing Level
3.OSEK OS Task Concept
4.OSEK OS Task Scheduler
5.Task API
6.Priority Ceiling
OSEK OS
1. Event Driven Control System
2. portability and re-usability of application
software
3. Special support for automotive requirements
4. ProOSEK(3Soft), OSEKTurbo(Metrowerks)
5. OSEK/VDK Specification
- OSEK OS
- OSEK COM
- OSEK Time OS
- OSEK FTCOM
- OIL
OSEK OS(cont..)
Task management
• Activation and termination of tasks
• Management of task states, task switching
Synchronisation
• Event control
• Resource management
Interrupt management
• Services for interrupt processing
Alarms
• Relative and absolute alarms
Intra processor message handling
• Services for exchange of data
Error treatment
• Mechanisms supporting the user in case of various errors
OSEK Processing Level
Processing levels of the OSEK operating system
OSEK defines three processing levels:
• Interrupt level
• Logical level for scheduler
• Task level
OSEK Processing Level(cont.)
The following priority rules have been established:
• Interrupts have precedence over tasks
• The interrupt processing level consists of one or more
interrupt priority levels
• Assignment of interrupt service routines to interrupt priority
levels is dependent on Implementation and hardware
architecture
• For task priorities and resource ceiling-priorities bigger
numbers refer to higher priorities.
• The task’s priority is statically assigned by the user
OSEK Task Concept
Task concept
• basic tasks
- Basic tasks switches to a higher-priority task
OSEK Task Concept
•Extended Task
1. The OSEK operating system provides a task switching mechanism
2. The OSEK operating system is responsible for saving and restoring task
context in conjunction with task state transitions whenever necessary.
3. Extended Task state model
OSEK Task Concept
1. Running
- The CPU is assigned to the task
- Task instructions execute
2. Ready
- Task waits for allocation of the processor
- The scheduler decides which ready task is
executed next.
3. Waiting
- A task cannot continue execution because it shall
wait for at least one event
4. Suspended
- Task is passive and can be activated
OSEK Task Scheduler
1. 0~15 Priority of a Task
2. Use 16 FIFO Queue Scheduler
Ready Queue
OSEK Task API
Task API
- DeclareTask(TaskIdentifier)
Parameter : TaskIdentifier
DeclareTask serves as an external declaration of a task.
- ActivateTask(TaskID)
Parameter : TaskID
The task<TaskID) is transferred from the suspended state into the ready state
- TerminateTask(void)
The task is transferred from the running state into the suspend state
- ChainTask(TaskID)
This service causes the termination of the calling task.
Next The Task(TaskID) is activated.
Priority Ceiling
To avoid the problems of priority inversion and deadlocks
OSEK use Priority Ceiling Protocol
High
Low
OSEK Priority Ceiling Protocol
Priority Ceiling
Resource assignment with priority ceiling between preemptable tasks and
interrupt services routines.
The task T1 is running and requests a resource shared with the interrupt
service routine INT1
Priority Ceiling
Resource assignment with priority ceiling between interrupt services routines
Reference
- SNU RTOSLab
http://redwood.snu.ac.kr/
-OSEK/VDX Portal
http://www.osek-vdx.org/
Q&A
감사합니다