Section 3: Software, Synchro and Device Drivers Flashcards

1
Q

What are the three abstraction layers of software?

A

From most abstract to least abstract: Main Program, Functional Layer, Hardware Abstraction Layer.

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

What is the purpose of the main program

A

Completely abstract code. May make use of functional layer APIs

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

What is the purpose of the functional layer?

A

The functional layer maps api actions into hardware calls

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

What is the purpoe of the hardware abstraction layer

A

The hardware abstraction layer comminucates with IO devices via ports, handles synchronization using polling and other low level operations

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

What are CPU and device Latency?

A

CPU latency: The time between the reciept of a service request and the beginning of processing. Device Latency: The amount of time between a request being sent and a response being recieved. CPU Latency < Device Latency

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

What is a real time system?

A

A system that garuntees worst case latency

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

What is Latency

A

The time between arrival of request and completion of service. Could consider avg or worst case

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

What is throughput

A

Measure of #of items processed per unit time

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

What are the five types of sychronization mechanisms

A

Blind Polling, Ocassional Polling, Periodic Polling, Tight Polling, Interrupt Handling

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

What is Blind Cycle Syncrho

A

Grab data at software’s convenience regardless of device status

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

What is Ocassional Polling

A

Device status is checked at a variable frequency (at designer’s convenience)

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

What is periodic polling

A

Device status is checked at a set frequency

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

What is Tight Polling

A

The software does no other meaningful work other than checking if the device is ready (empty loop)

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

What is Interrupt Handling

A

Device requests service from cpu by sending an interrupt signal

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

What is CPU oriented sychronization? Which mechanisms follow this?

A

Device waits for cpu (blind cycle, ocassional polling, periodic polling)

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

What is Device oriented synchronization

A

Device demands service from cpu (reduce latency). Examples: tight polling and interrupt handling

17
Q

What are the steps to do a read via tight polling

A

wait for ready (spin loop)
read data
clear data ready bit
process data

18
Q

What are the steps to do a write via tight polling

A

wait for device ready
clear ready signal
output data

19
Q

What are the 11 steps of handling an interrupt

A
  1. Device notifies CPU
  2. CPU completes current instruction
  3. CPU suspends execution
  4. Disable interrupts
  5. Save registers
  6. Acknowledge device (optional)
  7. Select ISR
  8. Run ISR
  9. Restore registers
  10. Re-enable interrupts
  11. Continue Main program execution
20
Q

What are the pros and cons of having a single vs multiple interrupt line

A

Pros: Less wires
Cons: Slower

21
Q

What are the two methods to selecting

A

Non Vectored: All interrupt requests are routed to a genral isr that polls each device to check which device fired the interrupt. The appropriate isr is then selected.
Vectored: Each request is associated with a vector. Vectors have priorities and associated ISRs at that vector address

22
Q

What are two rules for ISR programming

A

Execute as fast as possible, no blocking IO.

23
Q

What are 7 general steps for an ISR

A
  1. Save registers modified by the ISR
  2. Acknowledge Device
  3. Re enable interrupts
  4. Test for valid interrupt
  5. Run logic
    6 Resture registers (may need to disable interrupts)
  6. return
24
Q

How are interrupts initialized

A
  1. Disable all interrupts
  2. Enable Device Interrupts
  3. Set interrupt mask
  4. Initialize interrupt vectors with ISR adresses
  5. Enable interrupts
25
Q

What is a device driver

A

A driver is the software associated with a particular device. It includes data structures, initialization IO and ISRs