http://portal.osek-vdx.org/

 

1. OSEK이란?

 

OSEK(Open Systems and their Interfaces for the Electronics in Motor Vehicles) + VDX(Vehicle Distributed eXecutive)

 

- Initial Partners of OSEK : BMW, BOSCH, SIEMENS VDO, VOLKSWAGEN AG, DAIMLER CHRYSLER...

- VDX Member : Renault, Psa peugeot, citroen

 

::Motivation::
-High, recurring expense in the development and variant management of control unit software
-Incompatibility of control units made by different manufactures due to different interfaces and protocols

 

1-2. Goal

 

: 어플리케이션 SW를 어떻게 하면 이식성높게 만들수 있을까?  SW의 재사용을 어떻게 높일수 있을까?

 

1-3. System philosophy


1) Standardized interface
      : C와 같이 사용가능. System services are specified in an ISO/ANSI-C like syntax


2) Scalability
     : Different conformance classes, various scheduling mechanisms, configuration features


3) Error Checking
     : 개발단계시 에러체크는 Extended status for development phase로, 양산시 standard status for production phase

 

   4) Portability of application software
     : 기본적으로 표준 인터페이스로 개발하기 때문에 어플리케이션의 개발이 매우 쉽다. •A language for a

        OIL(OSEK Implementation Language) 라는 OSEK의 표준문법을 사용함 = Portability


5) Support of Portability
      : Increase portability of an application between various OSEK implementations


6) Support for automotive requirements(reliability, real-time capability and cost sensitivity)
      : Users statically specifies the number of tasks, resources, and alarms
        Predictable and documented behavior

 

1-4. major characters

- Task management  (Apps 을 task unit으로 나눠서 스케줄링한다)
   - Activation/Termination of tasks
   - Management of task states, task switching
   Synchronization
   - Event control
   - Resource management
     Interrupt management
     Alarms
     Intra processor message handling
     Error handing, tracing and debugging
   - OS provides six hook routines

 

 

2. Specification of OSEK OS

 

"  Tree processing levels로 나눠진다. "
  - Interrupt level
  - Logical level for scheduler
  - Task level

 

 

 

 

2-2. Objectives of Conformance classes

  - Provide convenient group of OS features for easier understanding and discussion

   : 구분을 통한 높은 가독성과 개발에 편리
  - Allow partial implementations
  - Create and upgrade path from classes of lesser functionally to classes of higher functionality with no changes   

     to the application

 

 

 

  Task의 분류는 위의 도표와 같이 Basic Task들을 Conformance classes로 나눈다.

  구체적인 내용은 아래의 그림참조.

 

 

 

 

2-3. Task management :  Task들을 나누는 이유는 '모듈화'

 

- Complex control software can be subdivided in parts executed according to their real-time requirements
- A task provide the framework for the execution of functions
- OS provides concurrent and asynchronous execution of tasks

 OSEK에서 제공하는 Two different task concepts
 : Basic Tasks (left), Extended Tasks (right)

   함수같은것.

 

 

 

- Activating a task : System Services,   ActivateTask or ChainTask
                          After activation, the task is ready to execute from the first statement
 - Multiple requesting of task activation
: Basic task only, Records parallel activation of a basic task already activated
 - Task switching mechanism
Scheduler
 - Decides which task shall be started and the triggering of all necessary OSEK OS internal activities
 :The scheduler is activated whenever a task switch is possible

 

 

2-4 Task Priority
The value 0 is defined as the lowest priority of a task (낮은값이 높은 우선순위를 가진다)
Not support the dynamic priority management  (절대적인 우선순위 고정)
     :User cannot change it at the time of execution
A preempted task is considered to be the first(oldest) task in the ready list
A task being released from the waiting state is treated like the last(newest) task

 

  **OSEK규격에서 제공하는 스케줄러의 예시

 

 

 

  수행중인 Task가 있는데 더 high-priority task가 ready가 되면 기존 Task를 대기로 놓되, 대신 다음번에 가장 높은 순위로 실행시켜준다는 내용..

 

-Scheduling policy


***Full preemptive scheduling 방식

 

 


- Rescheduling points
  •Termination of a task : TerminateTask
  •Termination of a task witch explicit activating of a successor task : ChainTask (다음실행할 task지정)

  •Activating a task at task level : Activate Task
  •Explicit wait call : WaitEvent
  •Setting an event to a waiting task : SetEvent
  •Release of resource : ReleaseResource
  •Return from interrupt level to task level

 

--------------------------------------------------------------------------------------------------------

*** Non preemptive scheduling

 

 

 

-Rescheduling points
  •Termination of a task : TerminateTask
  •Termination of a task witch explicit activating of a successor task : ChainTask
  •Explicit call of scheduler : Schedule
  •Explicit wait call : WaitEvent

 

 

3. Synchronization

 

 3-1. Event mechanism
- A means of synchronization
- Only provided for extended tasks
- System services
- SetEvent, WaitEvent, GetEvent, ClearEvent

 

 

 

    : Task2가 런닝상태있다가 Wait Event() 실행이되면 release 상태나 wait 상태로 간다.

 

 3-2. Event mechanism

 

1) Synchronization of preemptable extended tasks

 

 

2) Synchronization of non preemptable extended tasks

 

 

 

 

3-3 Resource management

- Co-ordinate concurrent access of several tasks with different priorities to shard resources
- Shared resources
  : E.g. scheduler, program sequences, memory or hardware
- System services
  : GetResource, ReleaseResource  (2가지의 리소스 호출만 존재함/ 동시획득은 못함, 바이너리 세마포어와 동일한원리)
- Ensures that
  :  * Two tasks cannot occupy the same resource at the same time
   

    * Priority inversion can not occur

 

   -> 우선순위 기반의 스케줄링이라면 위와같은 현상이 일어나지 않지만, 리소스의 공유로 인해 발생한다.


    * Deadlocks do not occur by use of these resources

 

  -> 서로의 리소스충돌로 인한 데드락 상태.  OSEK에서 Ceiling Protocol 사용을 통하여 위와같은 현상을 예방해준다.

 

3-4 Priority Ceiling Protocol

- To avoid the problems of priority inversion and deadlocks
- Behavior of priority ceiling protocol
   • Each resource has own ceiling priority
   • If the task requires a resource, and its current priority is lower that the ceiling priority of the resource, the priority

      of the task is raised to the ceiling priority of the resource
   • If the task release the resource, the priority of this task is reset to the original priority

 

 

  -> 우선순위도치나 데드락을 방지한다.

 

3-5. Interrupt Management

  :  OSEK에선 2가지로 ISR나누어서 사용한다.

 - Two ISR Categories
1) ISR Category 1  : Dose not use an OS System services
2) ISR Category 2 : Can use the OS system service

 

 -Rescheduling
Takes place on termination of the ISR category 2
The number of Interrupt priorities
Depends on the controller and implementation

 

- Alarms  : 반복적으로 발생하는 이벤트를 처리하기 위한 서비스
             Services for processing recurring events
- Counters
: Represented by a counter value 

     •“ticks”, and counter specific constants
- Alarm management
: An alarm will expire when a predefined counter value is reached
  Statically assigned at system generation time to
     •One counter
     •Activates task, sets event or calls alarm-callback routine

 

Example)

 

 

 

 

4. Intra Processor Message Handling

 

-Provided by OSEK COM specification
CCCA, CCCB only
Transmission of data between tasks


-Actions on receiving messages
Generation of an event
Activation of a task
Execution of a callback function

 

 

 

 

 

 

4-2. Hook Routines

: 특정한 상황에서 OS에 의해 호출되는 함수로써, 디버깅이나 모니터링 용도로 사용된다.

OSEK에는 Six hook routines이 존재한다.

   - Functions called by OSEK OS
- Have predefined names
- Enable
        • Reactions to special situation

        : ErrorHook, COMErrorHook
        • Monitoring or debugging services
           : PreTaskHook, PostTaskHook
        • Initialization or finalization by user
        : StartupHook, ShutdownHook

 

 

 

 

 

 

 

 

'Nobody tells you about.. > RTOS' 카테고리의 다른 글

[Embedded Systems] FSM :: Finite-State Machines  (0) 2013.05.17

A few days ago, I learned the notion of FSM in a major class. This means kind of expression tool to show system or any-state, when we want to explain the complicated situation or CS algorithm. This is a contents below in my textbook for easily understanding.


THE ONLY IN DISCRETE DYNAMICS,


1.The Notion of State

: the state of a system is its condition at a particular point in time.


we can define the state to be an encoding of everything about the past that has an effect on the system’s reaction to current or future inputs. The state is a summary of the past.


2.Then, What is a Finite-State Machines??..'제한된 상태들의 변화를 순차적으로 나타내는 장치'

:

A state machine is a model of a system with discrete dynamics that at each reaction

maps valuations of the inputs to valuations of the outputs, where the map may depend on

its current state.

Therefore, A finite-state machine (FSM) is a state machine where the set States of possible states is finite.

 

States = {State1; State2; State3}


3.Transitions


A transition is represented as a curved arrow, as shown in Figure 3.3.



The guard determines whether the transition may be taken on a reaction. The action specifies what outputs are produced on each reaction. In other words, the guard is condition for progressing next step(state) and the action means the an assignment of values (or absent) to the output ports.



EXAMPLE>


The transition is a symbol of arrow to move to next state, and the 'enabled' means can be a next state, when the conditions (such as P1,P2) is satisfied. (present(P) means there is a event at that time.) And also, the present has the meaning of true, the absent is false.

**Pure signal is input which has both a absent and present (event) such as UP,DOWN.


above example, The transition from state 0 to 1 has a guard written as up^:down. This is a predicate that evaluates to true when up is present and down is absent. 

------------------------------------------------------

UP : the event like a "come in 1 vehicle" (present),  DOWN : the event like a "come out 1 vehicle" (present)

if the absent occur, it means there isn't event.


These are standard logical operators where present is taken as a synonym for true and absent as a synonym for false. The symbol : represents logical negation. The operator ^ is logical conjunction (logical AND), and _ is logical disjunction (logical OR).





On a transition, the action (which is the portion after the slash) specifies the resulting valuation on the output ports when a transition is taken. If q1 and q2 are pure outputs and q3 has type N, then the following are examples of valid actions:

 


Any output port that is not mentioned in a transition that is taken is implicitly absent. (1Line)

When assigning a value to an output port, we use the notation name :=value to distinguish the assignment from a predicate, which would be written name = value. As in Figure 3.4, if there is only one output, then the assignment need not mention the port name.


::A default transition that need not be shown explicitly because it returns to the same state and produces no output.


The reaction is not shown explicitly in the diagram. Sometimes it is useful to emphasize such reactions, in which case they can be shown explicitly. A convenient way to do this is using a default transition, shown in Figure 3.6. In that figure, the default transition is denoted with dashed lines and is labeled with “true / ”.












'Nobody tells you about.. > RTOS' 카테고리의 다른 글

[Overview] OSEK  (0) 2013.06.04

+ Recent posts