Final Review Flashcards
What is an Embedded System?
Computer system purpose built for a specific application
What is a Real Time System?
Embedded system that returns results sufficiently quickly to affect current environment. Execution predictability is as important as speed
What is a hard deadline?
Failure to meet the deadline leads to total system failure
What is a firm deadline?
Infrequent misses can be tolerated but late data has no value
What is a soft deadline
Misses are acceptable, but late data has diminishing value
Why use C for RTS?
compact, compiled, no garbage colleciton.
How does a struct differ from a class?
no member functions, no private/public protection
Why do we define special types such as uint32_t?
Increases portability across systems
What are the 5 components of a basic computer
Input, Output, Memory, ALU, Control
How many memory locations are adressable with a 32 bit address?
2^32 Memory locations
What is the difference between big and little endian
Big endian, most significant byte is stored in a lower address. Little endian, most significant byte is stored at the lower address.
What are the four types of memory
Text, Data, Heap, Stack
What is the difference between Volatile and Non Volatile memory
Volatile memory loses its contents when power is lost.
What are examples of volatile memory
DRAM, SRAM
What are examples of non volatile memory?
Disk, Tape, NAND Flash
What is a MCU?
Memory Controller Unit. Processor with memory, I/O, UART and RTC
What is memory mapped IO?
IO devices are mapped to memory locations and can be written to to change behavior or read from to recieve data.
How does polling IO work
Repeatedly check I/O status register until data is ready.
What are the downsides to polling IO?
Wastes time repeatedly checking the status register
What is an alternative to polling IO?
Interrupt based IO
How does interupt IO work?
IO device throws a IRQ which is mapped to a corresponding ISR using a vector table. The ISR handles the IO, and restores the context
When can an ISR be interrupted?
When a higher priority IRQ is received. Otherwise, any incoming IRQs must wait for the ISR to finish
What features must ISRs have
Must be re-entrent: no static variables
What is Bare Metal Scheduling
Hard Code tasks to run at certain loop intervals, using lowest common denominator
What is Concurrency
multiple tasks running independently with their own context
What parameters define a task
Start Time, Deadline, Period, Execution Time
What is an easy check to see if a set of tasks is scheduable?
The summation of execution times over periods must be less than 1
What is non preemptive scheduling
Schedule is created in advance. Each task runs for a specified amount of time and cannot be interrupted
What is Round Robin Scheduling
Each task is given the same time slice (equal priority). Implemented using a queue.
What is EDF Scheduling?
Earliest Deadline First. Task with the closest deadline has highest priority. Can be pre-empted if a task with a earlier deadline arrives.
How is EDF implemented?
Using a ready queue and a waiting queue. (Heaps). A interrupt is set for the release time of the head of the waiting queue.
What is RM/Fixed Priority Preemptive Scheduling
Tasks with equal priority are run in round robin fashion. Can be interrupted if a higher priority task arrives
How is RM scheduling implemented
array of linked lists.
What is a Semaphore
A non-negative counter. Has a init, wait and signal funciton.
What is a Mutex
A mutex is a binary semaphore. Has a value of 0 or 1. TODO: Add functions
What is Condition Variable Synchronization
One task waits for another task to signal a semaphore once a certain event has occured.
What is Rendezvous Synchronization
Two semaphores are initialized to 0. Each task signals one semaphore and then waits on the other. Both tasks must wait until both have reached the rendezvous
What is Barrier Synchronization?
A extension of Rendezvous. There is a counting semaphore, a barrier semaphore and a locking mutex. When each task reaches the barrier it increments the counting semaphore and then waits on the barrier. The last task to arrive increments the counting semaphore to n, which allows the task to increment the barrier. Once past the barrier wait, each task signals the barrier semaphore so the other tasks can go through
What is mutual exclusion
Wrap shared memory access with a wait/signal block to prevent two tasks from modifying the same variable at the same time.
What is Priority Inversion?
A task with a lower priority blocks a higher priority task by holding a mutex
How do you prevent priority inversion
temporarily raise the priority of the mutex holder task to maximum priority
What is arecursive mutex
task can acquire mutex multiple times (recursively) without blocking. Mutex must be released an equal number of times.
What rule of thumb is there for mutex hold length
hold mutexs for the minimum possible duration
What is deadlock
No tasks can procede, as each task is waiting on a held mutex.
What is one possible solution to deadlock?
Ordered resource allocation. Have all tasks accept one pickup resources in the same direciton
What is the producer consumer communication model
One task produces data, another task consumes data. Data is passed via messages between them