io device drivers Flashcards
what are device drivers
code to manage a device
single-instance devices
devices that can only be used by one process at a time e.g. printer
multi-instance devices
devices that can handle requests from multiple processes by creating another instance of the internal data structures
e.g. disk
what are the 4 tasks that device drivers carry out
io scheduling
caching
error handling
io protection management
how can device drivers provide protection for io devices
only allowed operations can be completed
raw devices
the operation and data are returned to the application
cooked devices
the operation is handled and the data is returned
how do device drivers schedule the operations that theyre carrying out
when it receives a set of request sit may reorder them to make the most efficient use of the underlying hardware
e.g. reorder reads and writes so they go with the natural flow of the head of the disk instead of going back and forth
character based devices
processes an arbitrary number of characters
no structure
e.g. terminal
block based devices
will carry out operations on a block of bytes at a time or a multiple of them
e.g. disks
what is unix’s interface orientation
file
in unix what does the device driver interface look like
file operation e.g. open()
in unix the os creates a table for each device driver operation
how is this used
the starting address of the routine to carry out the specific operation for that device driver is stored
how are device drivers an extensible model
they interact with the os via well defined knows published programming interfaces
developers write code that uses the os driver api to interact with the hardware
what is the benefit of modular os when adding device drivers
dont have to restart the system to do it
can dynamically add device drivers at runtime