System Software Flashcards
Characteristics of Embedded Operating System: Configurability
- Enable/Disable parts of operating system
- conditional compilation (#if #ifdef preprocessor macros for disabling part of program)
- object-orientation could lead to a derivation of sub-classes
- aspect-oriented programming
- linker-time optimization (remove unused functions)
- dynamic data might be replaced by static data
How is device access handeled in an embedded OS opposed to in a standard OS?
Middleware and applications can directly access device drivers which makes them fast! (ie. Access does not have to “ask” OS to use the screen)
In normal OS only the operating system has access to device drivers, manly because of security reasons.
Characteristics of embedded OS: Protection
- Protection mechanisms not always necessary, untested software always never used -> considered reliable
- protection mechanisms may be needed for safety, security and certification reasons
Charac. of emb. OS: Interrupts
- interrupts are not restricted to OS, can be employed by any process any time
- more Efficient than going through OS services
- reduces composability (if software is connected to interrupt, it may be difficult to add more SW which also starts by an event)
Charac. of emb. OS: Real-time capability, requirements?
- RTOS (real-time operating system)
- Def.: A real-time operating system (RTOS) is an operating system that supports the constructuon of real-time systems.
Requirements:
- Timing behavior must be predictable (what are upper and lower bound of execution time), ability to disable interrupts
- OS should manage the timing and scheduling (awareness of task deadlines, ability to provide precise time services)
- FAST
Charac. of emb. OS: Internal Synchronization
- sync with one master clock (typically at start-up)
- distributed synchronization:
1. collect information from neighbors
2. compute correction value
3. apply correction value
Charac. of emb. OS: External Synchronization
- external sync guarantees consistency with actual physical time (ie. GPS satelites giving UTC or TAI, resoultion is 100ns)
- Problems: Fault Tolerance (what if value is wrong?)
- -> accepting only small changes from local time
Class of RTOS: Fast Proprietary Kernels
For complex systems, these kernels are inadequate because they are designed to be fast rather than to be predictable in every aspect.
Examples: QNX, PDOS, VCOS, VTRX32, VxWorks
Class of RTOS: RT Extensions to Standard OSes
Hybrid solution, where a RT-kernel is running all RT-tasks and the standard OS is executed as one task.
+ crash of standard OS does not affect RT-tasks
- but RT-tasks cannot use services of standard OS
Resource Access Protocols: Critical Sections, how?
Sections of code at which exclusive access to some resource must be guaranteed. Can be guaranteed with semaphores S (only if S is acquired, there is access, otherwise access blocked).
What is priority inversion?
- Top priority task is delayed by lower priority tasks (can happen if there are more than two task with semaphore logic)
- Case: Prio 1 gives away Semaphore to wait for Prio 3 data. In the meantime Prio 2 takes semaphore and needs very long until releasing it causing in the case of the mars robot a complete reset induced by the watchdog for Prio 1 task
Solutions to priority inversion?
- Disallow preemption during execution of all critical sections
- Priority inheritance protocol: Rule that tasks inherit the highest priority of tasks blocked by it (V4 p. 38ff)
Remarks on Priority Inheritance Protocol?
- possibly large number of tasks with high priority
- possible deadlocks
- is an application in ADA: during rendevouz, task priority is set to maximum
- protocol for fixed set of tasks is called: Priority Ceiling protocol (PCP)
What is the Priority Ceiling Protocol (PCP)?
- priority protocol for fixed set of tasks
- PCP avoids multiple blocking
- guarantees that once a task has entered critical section, it cannot be blocked by lower priority task until its completion
- Priority ceilings assigned to tasks beforehand (ie. S0 = T1 ; S1 = T1, T2 ; S2 = T2, T3)
@@@@ Not really understood (V4 p. 38ff)
PCP: properties?
(Priority Ceiling Protocol)
- no deadlocks (only changing priorities)
- a given task i is delayed at most once by a lower-priority task