Final Review Flashcards

1
Q

What is an Embedded System?

A

Computer system purpose built for a specific application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Real Time System?

A

Embedded system that returns results sufficiently quickly to affect current environment. Execution predictability is as important as speed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a hard deadline?

A

Failure to meet the deadline leads to total system failure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a firm deadline?

A

Infrequent misses can be tolerated but late data has no value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a soft deadline

A

Misses are acceptable, but late data has diminishing value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why use C for RTS?

A

compact, compiled, no garbage colleciton.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does a struct differ from a class?

A

no member functions, no private/public protection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why do we define special types such as uint32_t?

A

Increases portability across systems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the 5 components of a basic computer

A

Input, Output, Memory, ALU, Control

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How many memory locations are adressable with a 32 bit address?

A

2^32 Memory locations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between big and little endian

A

Big endian, most significant byte is stored in a lower address. Little endian, most significant byte is stored at the lower address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the four types of memory

A

Text, Data, Heap, Stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the difference between Volatile and Non Volatile memory

A

Volatile memory loses its contents when power is lost.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are examples of volatile memory

A

DRAM, SRAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are examples of non volatile memory?

A

Disk, Tape, NAND Flash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a MCU?

A

Memory Controller Unit. Processor with memory, I/O, UART and RTC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is memory mapped IO?

A

IO devices are mapped to memory locations and can be written to to change behavior or read from to recieve data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How does polling IO work

A

Repeatedly check I/O status register until data is ready.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the downsides to polling IO?

A

Wastes time repeatedly checking the status register

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is an alternative to polling IO?

A

Interrupt based IO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How does interupt IO work?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

When can an ISR be interrupted?

A

When a higher priority IRQ is received. Otherwise, any incoming IRQs must wait for the ISR to finish

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What features must ISRs have

A

Must be re-entrent: no static variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is Bare Metal Scheduling

A

Hard Code tasks to run at certain loop intervals, using lowest common denominator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is Concurrency

A

multiple tasks running independently with their own context

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What parameters define a task

A

Start Time, Deadline, Period, Execution Time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is an easy check to see if a set of tasks is scheduable?

A

The summation of execution times over periods must be less than 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is non preemptive scheduling

A

Schedule is created in advance. Each task runs for a specified amount of time and cannot be interrupted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is Round Robin Scheduling

A

Each task is given the same time slice (equal priority). Implemented using a queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What is EDF Scheduling?

A

Earliest Deadline First. Task with the closest deadline has highest priority. Can be pre-empted if a task with a earlier deadline arrives.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

How is EDF implemented?

A

Using a ready queue and a waiting queue. (Heaps). A interrupt is set for the release time of the head of the waiting queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is RM/Fixed Priority Preemptive Scheduling

A

Tasks with equal priority are run in round robin fashion. Can be interrupted if a higher priority task arrives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

How is RM scheduling implemented

A

array of linked lists.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What is a Semaphore

A

A non-negative counter. Has a init, wait and signal funciton.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is a Mutex

A

A mutex is a binary semaphore. Has a value of 0 or 1. TODO: Add functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What is Condition Variable Synchronization

A

One task waits for another task to signal a semaphore once a certain event has occured.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

What is Rendezvous Synchronization

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What is Barrier Synchronization?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

What is mutual exclusion

A

Wrap shared memory access with a wait/signal block to prevent two tasks from modifying the same variable at the same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What is Priority Inversion?

A

A task with a lower priority blocks a higher priority task by holding a mutex

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

How do you prevent priority inversion

A

temporarily raise the priority of the mutex holder task to maximum priority

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

What is arecursive mutex

A

task can acquire mutex multiple times (recursively) without blocking. Mutex must be released an equal number of times.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What rule of thumb is there for mutex hold length

A

hold mutexs for the minimum possible duration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

What is deadlock

A

No tasks can procede, as each task is waiting on a held mutex.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

What is one possible solution to deadlock?

A

Ordered resource allocation. Have all tasks accept one pickup resources in the same direciton

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What is the producer consumer communication model

A

One task produces data, another task consumes data. Data is passed via messages between them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

What are some examples of producers and consumers

A

producers: sensor data, user input. Consumers: control tasks/

48
Q

What is a handshake protocol

A

Producer must wait for the Consumer to be ready to recieve data before data can be sent. The Consumer must wait for a message to be ready before it can read data.

49
Q

What problems are there with producer consumer?

A

The consumer must copy the data into a temporary variable. Not ideal for longer messages.

50
Q

What is Double Buffering?

A

Two buffers, with a full count and empty count semaphore to indicate state. Allows producer to fill the second buffer while consumer reads the first

51
Q

How do you allocate a double buffer?

A
const SIZE = 512;
uint8_t  data[2*SIZE]
uint8_t buff_ptr[2] = {&data[0], &data[size]}
52
Q

How does a double buffer operate?

A

producer waits for non 0 empty count, fills its indexed buffer, signals the full count then increments its index. The consumer waits on non 0 full count, consumes the data from its buffer, signals empty count then increments its index

53
Q

What is a Message Queue?

A

multiple producers and consumers share a queue of arbitrary size

54
Q

How is a message queue implemented?

A

array of memory locations, indexes for the start of full and the start of empty. semaphores for full and empty count and a mutex to enforce mutual exclusion when accessing and mutating

55
Q

How can a message queue avoid copying data

A

only store pointers to the data in the queue, instead of the data itself

56
Q

TODO: KEIL MAILBOXES

A

asdfasdf

57
Q

How do you size a buffer with constant p(t) and c(t)

A

if c(t) < p(t), Buffer size = (p(t)-c(t))*burst time

58
Q

How can you check if buffer sizing will prevent data loss

A

Compare average consumer rate and producer rate over the burst period. If c_avg > p_avg, no data will be lost

59
Q

TODO: Variable p(t) and c(t)

A

sasdfasdf

60
Q

What are the main variables of queuing theory

A

Average arrival rate: lambda, average service rate: u. Load factor: lambda/u

61
Q

What are the two models of queing theory

A

Deterministic and Markov

62
Q

In a deterministic model, what can be said about the arriavl time of clients and service?

A

Clients/servers have a regular period, equal to 1/lambda or 1/u.

63
Q

What separates a markov process from a deterministic process

A

time between each arrival in a markov process is independent of the previous arrivals. It is a memory less, stochastic process

64
Q

What equation governs the arrival time of a markov process

A

p(t) = lambdae^(-lambdat)

65
Q

What is the average queue length in queuing theory?

A

L = rho/(1-rho)

66
Q

What is the average time in the system in queuing theory?

A

W = L/lambda = (1/u)/(1-rho)

67
Q

What is the probability of having more than k customers?

A

P(x>k) = rho^k

68
Q

What law governs the relationship between queue length and average system time?

A

Little’s Law: L = lambda*W

69
Q

What is a PID Controller

A

Proportional Integral Differential Controller.

70
Q

What is the purpose of the P in a PID controller

A

The response of the controller is proportional to the error. The larger the error, the larger the response

71
Q

What is the purpose of the I in a PID controller?

A

The response of the controller increases as error accumulates. (The integral of the area can be estimated using a summation)

72
Q

What is the purpose of the D in a PID controller

A

The Differential means that the response is proportional to the rate of changes. Sudden jumps in error lead to large responses.

73
Q

What is a ADC and DAC?

A

Analog to Digital Converter, Digital to Analog Converter

74
Q

What is CAN

A

Controller Area Network. High integrity, serial, broadcast bus. Speeds up to 1 Mbps

75
Q

How many wires are in a CAN network

A

2, CAN Hi and CAN Lo.

76
Q

What two modes are there on a CAN network

A

Dominent: Hi is 5V, Low is 0 V and Recessive: Hi is 2.5 V, Lo is 2.5V. The wires default to recessive when no signal is transmitted. Dominant is taken as a 0, recissive is taken as a 1.

77
Q

How are CAN messages sent?

A

In Frames, to all other nodes in the network. (up to 112)

78
Q

what are the four types of frames in CAN?

A

Data, Remote, error, overload?

79
Q

What components are there in a CAN Frame Format

A

Start of frame, 11 bit ID, remote transit bit, data length code, data bytes, CRC,delimiter, ack, 7 bit EOF, 3 bit inter frame space.

80
Q

How does CAN determine who is next to transmit

A

Nodes transmit once network is idle. If two nodes transmit at the same time, the logical and of their signals is received. If a node detects a difference between the network and its message, it goes idle. Therefore, nodes with lower IDs have higher priority.

81
Q

How does CRC work

A

Cyclic Redundancy Check. Divide message by a 3rd order polynomial (1011). pad the original message with 0s to determine the CRC. To check message, add the CRC to the end of the message and confirm the remainder is 0.

82
Q

What are the layers of the OSI Network Model

A

Application, Presentation, Session, Transport, Network, Data Link, Physical.

83
Q

What is the role of the physical OSI Layer

A

transmit the bits from one host to another

84
Q

What is the role of the data link OSI layer

A

packages data into frames, checks for errors and provides acknowledgment

85
Q

What is the role of the network layer

A

Routes packets through the network, controls congestion

86
Q

What is the role of the transport layer

A

creates connections, orders messages

87
Q

what is the role of the session OSI layer

A

dialogue control and synchronization

88
Q

what is the role of the presentation OSI layer

A

encoding, compression and encyrption

89
Q

what is the role of the application OSI layer?

A

Http, ssh, ftp, smtp

90
Q

What layer would a Hub be used at?

A

Physical. It broadcasts incoming packets to all ports

91
Q

What layer would a switch be used at?

A

Data Link. It forwards packets based on MAC address.

92
Q

What layer would a router be used at

A

Network. If forwards packets based on IP.

93
Q

What is the difference between OSI layers 1-3 and 4-7

A

1-3 are between machines, while 4-7 are end to end protocols

94
Q

What network was the predecessor to the internet

A

ARPANET (advancecd research projects agency). Connected super computers at universities

95
Q

In TCP/IP, what OSI layers do the Application layers map to ?

A

App, Presentation and Session map to HTTP/SMTP

96
Q

In TCP/IP what OSI layers do the Transport Layers map to?

A

Session and Transport. Goverend by the TCP/UDP protocol

97
Q

In TCP/IP what OSI layer does the internet layer map to

A

Network, goverend by IP.

98
Q

In TCP/IP what protocols govern the Data Link and Physical OSI layers

A

MAC, Ethernet, Wifi

99
Q

How is a packet structured?

A

Each Protocol adds its own header, (Application, TCP, IP, Ethernet. Total packet length is between 46 and 1500 bytes.

100
Q

Why is IP unreliable for packet routing?

A

routes packets hop by hop. Can lead to duplication, delay, or out of order recieving

101
Q

What solutions are there for unreliable IP packet routing

A

TCP protocol. uses handshaking and sequence #s to ensure all data gets to host in order. Creates a virtual circuit between hosts with sockets at each end.

102
Q

What are some common ports?

A

20: FTP, 80: HTTP, 443: HTTPS, 22 SSH, 143: IMAP, 587, SMTP.

103
Q

What are the components of a TCP Header?

A

Source Port, Destination Port, Sequence Number, Ack, Hlen, flags, window, checksum, urgent pointer, options.

104
Q

What differentiates UDP from TCP?

A

UDP is connectionless, it is faster but far less stable ( no ack or sequence number

105
Q

What makes up a UDP Header?

A

Source Port, Destination Port, Length, Checksum

106
Q

What steps are there on the server side fro socket programming

A

create socket, bind socket to port, listen for connection, accept connection, recieve/send data

107
Q

What steps are there on the client side for socket programming?

A

Create a socket, request a connection, send/recieve data

108
Q

What makes up a task control block?

A

Priority, delay time, stack pointer, next/previous pointers for wating list, state, ID

109
Q

What are the three types of Exceptions?

A

Interrupter - request for service from peripherals, Faults- Problems executing instructions (Errors, Exceptions) Trap- Instruction that invokes a OS Service

110
Q

What Items are in the Text, Data, Heap and Local Memory Segment

A

Text: The physical program and constants. Data: global and static variables. Heap: dynamically allocated memory. Stack: local variables, call stacks and pointers to dynamic memory.

111
Q

How do you know if RM is schedulable?

A

Product of 1+Ci/Ti < 2

112
Q

What are the four conditions for deadlock?

A

Hold and Wait, No Pre-emption of resources, Mutual Exclusion, Circular Waiting

113
Q

What are the four task states

A

Running, Waiting (waiting to be run), Inactive and Ready

114
Q

What is spin lock

A

Busy waiting (used for semaphore waits) useless.

115
Q

What are alternatives to spin lock?

A

spin lock w/ coop : forfeit execution if waiting.

Blocking Semaphore: Add task to waiting queue until semaphore is signaled, then its returned to the ready queue.