背景和基本原理
An AUTOSAR OS must be capable of supporting a collection of Operating System
objects (Tasks, ISRs, Alarms, Schedule tables, Counters) that form a cohesive
functional unit. This collection of objects is termed an OS-Application.
autosar os application 包含Tasks, ISRs, Alarms, Schedule tables, Counters。
There are two classes of OS-Application:
(1) Trusted OS-Applications are allowed to run with monitoring or protection
features disabled at runtime. They may have unrestricted access to memory,
the Operating System module’s API, and need not have their timing behaviour
enforced at runtime. They are allowed to run in privileged mode when
supported by the processor. The Operating System module assumes that
trusted OS-Applications (and trusted functions) do not cause an memory
related protection fault. If such a fault happens the system stability is likely
gone and a shutdown may be the only option
(2) Non-Trusted OS-Applications are not allowed to run with monitoring or
protection features disabled at runtime. They have restricted access to
memory, restricted access to the Operating System module’s API and have
their timing behaviour enforced at runtime. They are not allowed to run in
privileged mode when supported by the processor.
有两种类型的OS-Application: 受信任的和非受信任的。
It is assumed that the Operating System module itself is trusted
操作系统本身默认为是受信任的
Note that Resource obejcts do not belong to any OS-Application, but access to them
must be explicitely granted. (The same principle applies to spinlocks in Multi-Core
systems)
不属于OS-application的Resources访问需要被显式授权。
OS-Applications have a state which defines the scope of accessability of its
Operating System objects from other OS-Applications. Each OS-Application is
always in one of the following states:
- Active and accessible (APPLICATION_ACCESSIBLE): Operating System objects
may be accessed from other OS-Applications. This is the default state at startup. - Currently in restart phase (APPLICATION_RESTART). Operating System objects
can not be accessed from other OS-Applications. State is valid until the OSApplication calls AllowAccess(). - Terminated and not accessible (APPLICATION_TERMINATED): Operating
System objects can not be accessed from other OS-Applications. State will not
change
OS-Application有三种访问状态,APPLICATION_ACCESSIBLE,APPLICATION_RESTART,APPLICATION_TERMINATED。