AUTOSAR Operating System
AUTOSAR Operating System
Table of Contents
Definitions
Specification
OS Application(s)
Scalability Class
Configuration
`OsAlarm`
`OsCounter`
`OsTask`
`OsResource`
`OsApplication`
`OsOS`
API(s)
Additional Features
Schedule Table(s)
Specification
Synchronization
Configuration
`OsScheduleTable`
Spinlock(s)
Specification
Configuration
`OsSpinlock`
API(s)
Content
Definitions
Inter-arrival Time:
For basic tasks, this is the time between successively entering the READY state
from the SUSPENDED state.
For extended tasks, this is the time between successively entering the READY
state from the SUSPENDED or WAITING state. Note that waiting for an event that is
already set represents a new arrival.
For interrupts, this is the time between successive occurrences of the interrupt.
Specification
OS Application(s)
Note: The right to access an OS object by other OS Application(s) must be granted explicitly
(i.e., via the configuration reference Os<...>AccessingApplication ).
Note: An event is accessible if the task for which the event belongs to (i.e., may wait on) is
accessible.
Scalability Class
The Scalability Class of the OS is a configuration parameter, that specifies the features (e.g.,
memory protection, timing protection) that shall be supported by the OS.
Configuration
OsApplicationHooks [C, 1]
OsAppStartupHook [P, 1]
OsAppShutdownHook [P, 1]
OsAppErrorHook [P, 1]
OsOS [C, 1]
OsStatus [P, 1]
OsNumberOfCores [P, 0..1]
OsScalabilityClass [P, 0..1]
OsStackMonitoring [P, 1]
OsHooks [C, 1]
OsStartupHook [P, 1]
OsShutdownHook [P, 1]
OsErrorHook [P, 1]
OsProtectionHook [P, 1]
OsPreTaskHook [P, 1]
OsPostTaskHook [P, 1]
OsAlarm
Path: OsAlarm/OsAlarmAutostart/OsAlarmAlarmTime
Description: The number of ticks, at which the alarm initially expires.
Path: OsAlarm/OsAlarmAutostart/OsAlarmCycleTime
Description: The number of ticks, at which the alarm cyclically expires. If
zero, the alarm is not cyclic.
Path: OsAlarm/OsAlarmAutostart/OsAlarmAutostartType
Description: Specifies whether upon 'StartOs', 'SetRelAlarm' or
'SetAbsAlarm' is called.
OsCounter
Path: OsCounter/OsCounterMaxAllowedValue
Description: The maximum number of ticks, before the counter wraps to zero.
Path: OsCounter/OsCounterMinCycle
Description: The minimum cycle that may be specified for alarms, using
`Set<...>Alarm` API(s), referencing this counter.
Path: OsCounter/OsCounterType
Description: Specifies whether the counter is driven by hardware (i.e., via
a timer unit), or software (i.e., incremented using 'IncrementCounter' API).
OsTask
Path: OsTask/OsTaskActivation
Description: The maximum number of queued task activations to support. If
set to one, then queuing of task activation requests is not supported for
this task.
Path: OsTask/OsTaskPriority
Description: The priority of the task, where a higher value corresponds to a
higher priority.
Path: OsTask/OsTaskSchedule
Description: The preemptibility of the task, 'NON' (i.e., not preemptable)
or 'FULL' (i.e., preemptable).
Path: OsTask/OsTaskEventRef
Description: Reference to an event, that this task may wait on.
Path: OsTask/OsTaskResourceRef
Description: Reference to a resource, that this task may acquire.
Path: OsTask/OsTaskTimingProtection/OsTaskTimeFrame
Description: Minimum inter-arrival time.
OsResource
Path: OsResource/OsResourceProperty
Description: Resource type, whether 'INTERNAL' or 'STANDARD'.
OsApplication
Path: OsApplication/OsTrusted
Description: Implementation-specific, usually toggles between execution in a
higher/lower-level processor privilege mode (e.g., supervisor and user).
Path: OsApplication/OsTrustedApplicationWithProtection
Description: Implementation-specific, usually toggles between access to
peripheral address-space.
OsOS
Path: OsOS/OsStackMonitoring
Description: In the absence of an MPU hardware unit, this specifies whether
software stack monitoring is enabled for tasks and CAT2 ISR(s).
Path: OsOS/OsStatus
Description: Specifies the status mode of the OS, as per [1].
API(s)
Name Description
<...>TaskAsync(...) Similar to <...>Task , primarily used for across cores.
<...>EventAsync(...) Similar to <...>Event , primarily used for across cores.
ProtectionHook() Called after the system has ran into a fatal error. Based on its
return value, several different action(s) may be executed by
the OS, including a ShutdownOS call.
IncrementCounter(ID) Increments a software counter.
Note: For asynchronous call(s), possible error(s) are not reported to the caller directly.
Note: Refer to [2] for a chart showing which API(s) may be called from which context(s).
Additional Features
Schedule Table(s)
Specification
A Schedule Table defines a duration, and a series of expiry points to occur within this
duration. With each expiry point, task(s) may be activated and event(s) may be set.
Note: For each expiry point, all task activation(s) are processed first, then all event(s) are
set.
Note: NextScheduleTable may be used to stop, after the current cycle, and start another
schedule table, as long as both are driven by the same counter.
Synchronization
In explicit synchronization, the schedule table is driven by a counter, as usual, but it must be
synchronized on a counter value, called the synchronization counter, that is not a OS
counter object.
Note: The schedule table duration must be equal to the modulus of the synchronization
counter.
Note: Unlike in implicit synchronization, explicit synchronization requires that the schedule
table's zero tick occurs when the synchronization counter tick value is zero as well.
Configuration
OsScheduleTable
Path: OsScheduleTable/OsScheduleTableAutostart/OsScheduleTableAutostartType
Description: Specifies the API to use to start the schedule table.
Range:
ABSOLUTE (i.e., StartScheduleTableAbs)
RELATIVE (i.e., StartScheduleTableRel)
SYNCHRON (i.e., StartScheduleTableSynchron)
Path: OsScheduleTable/OsScheduleTableSync/OsScheduleTableSyncStrategy
Description: Specifies the sync strategy, whether IMPLICIT or EXPLICIT.
Path: OsScheduleTable/OsScheduleTableSync/OsScheduleTblExplicitPrecision
Description: When the sync strategy is EXPLICIT, it specifies the precision
(i.e., tick difference) below which the schedule table is considered
synchronized.
Spinlock(s)
Specification
A spin-lock is a busy-wait mechanism, that uses a test-and-set hardware instruction to
synchronize access to a variable across multiple cores.
Note: When acquiring spin-lock(s), in a nested fashion, it is permitted to skip spin-lock(s) in-
between.
Configuration
OsSpinlock
Path: OsSpinlock/OsSpinlockLockMethod
Description: Specifies the action to take, before/after acquiring/releasing
a spin-lock.
Range:
LOCK_ALL_INTERRUPTS
LOCK_ALL_CAT2_INTERRUPTS
LOCK_WITH_RES_SCHEDULER
LOCK_NOTHING
Path: OsSpinlock/OsSpinlockSuccessor
Description: References the spin-lock next in the linked list, that may be
acquired.
API(s)
Name Description
GetSpinlock Acquire a spin-lock, busy-wait if already occupied.
TryToGetSpinlock Acquire a spin-lock, return if already occupied.
ReleaseSpinlock Release a spin-lock.
References