Drivers Flashcards
what is a device driver? name 3 things they can do
a hardware-specific translator between userspace and hardware.
they play sound, display graphics, access a network
why do most major OS support userspace drivers?
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 are modern devices controlled by drivers? (i/o)
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 does Unix view devices?
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 does Windows view devices?
as files. 3 types
Direct I/O, buffered I/O and neither