Lecture Notes for Operating Systems Concepts

14 October 2002 - Device Management


  1. devices

    1. information repositories

    2. devices differ in their ability to handle information

      1. input (mouse), output (audio), input-output (disk)

      2. transfer rates, quantities, qualities

  2. device management objectives

    1. protection - devices are shared objects; they handle unshared information

    2. convenience - devices are gnarly, varied, and always changing

    3. efficiency - devices are bottle-necks; they are abstract

    4. the central conflict - abstraction vs. control; convenience vs. efficiency

  3. device management - efficient data transfer between device and system

    1. io system organization - the device driver, the resource manager

      1. provide interfaces - application, kernel, and device

      2. operate the device

      3. keep track of pending requests

      4. enforce the resource policy

  4. general device operation

    1. establish data and parameters; kick off the operation; wait for completion; determine status; handle results; repeat

    2. which does what - cpu vs. device; the trend is to move function from the cpu to the device

    3. cpu-device interactions

      1. the cpu directs the device, and possibly helps with some functions - error recovery

      2. polling

        1. cpu continually tests for completion

        2. doesn't scale well, difficult to get right, wastes cpu

      3. interrupt driven io - efficiently waiting for completion

        1. the device informs the cpu when completed

        2. scales well, relatively easy to program, efficient cpu use

      4. direct memory access - moving data between the device and system

        1. devices may have buffers to store data

        2. the cpu can do it - expensive

        3. the device can do it - needs access to memory; capable devices

    4. buffering

      1. amortize operations over more data - n 1-byte operations vs 1 n-byte operation

      2. smooth out bursty data transmissions
      even out the speed disparity - double buffering

    5. memory-mapped io - how do the cpu and devices communicate

      1. special cpu instructions

      2. writing locations memory - memory-mapped io

  5. device drivers

    1. interface - uniformity, abstraction vs. control

      1. application interface

        1. allocate, deallocate, specify information

        2. read, write, sense status

        3. control, manipulate, query

      2. kernel interface

        1. loadable kernel modules

        2. initialize, decommission, status

      3. device interface

        1. varies with the devices; a back-end to the device driver

        2. another interface, this one internal and messier

    2. io optimization

      1. why optimize - overcome performance disparities; allow greater capacity; offload function; exploit hardware capability

      2. what optimizes

        1. application - specific knowledge; difficult

        2. os - reasonable historic knowledge; fragile and complex

        3. device - no special knowledge; simple and universal; not as effective and may get in the way

    3. examples

      1. serial devices - bit-by-bit (not addressable); slow; limited capacity; fully automated - modems

      2. sequential storage devices - bi- or uni-directionally addressable; slow; high capacity

      3. random access storage devices - randomly addressable; slow to fairly fast; low to high capacity


This page last modified on 14 October 2002.