Drivers Flashcards

1
Q

what is a device driver? name 3 things they can do

A

a hardware-specific translator between userspace and hardware.
they play sound, display graphics, access a network

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

why do most major OS support userspace drivers?

A

having drivers in userspace follows the microkernal approach

having them in user space means that if they crash the entire system doesn’t crash

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

how are modern devices controlled by drivers? (i/o)

A

changing the value of their I/O registers
either memory-mapped or port-mapped

m-mapped:
registers are mapped into a memory address region and listen for specific addresses on the address bus
controlling the device amounts to just writing to memory

port-mapped: uses separate instructions for writing to I/O registers. often faked by mapping port addresses to memory addresses

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

how does Unix view devices?

A

as files. 3 types

character devices:

  • direct, unbuffered access
  • used for real-time devices: sound, graphics

block devices:

  • buffered access
  • used for storage: HDD, tapes

network devices:

  • packet-based, use specific system calls
  • built on top of a socket abstraction

communicate with the driver by reading and writing to these files using system calls

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

how does Windows view devices?

A

as files. 3 types

Direct I/O, buffered I/O and neither

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