Transforming I/O to Hardware Operations

13.5 Transforming I/O Requests to Hardware Operations

  • Users request data using file names, which must ultimately be mapped to specific blocks of data from a specific device managed by a specific device driver.
  • DOS uses the colon separator to specify a particular device ( e.g. C:, LPT:, etc. )
  • UNIX uses a mount table to map filename prefixes ( e.g. /usr ) to specific mounted devices. Where multiple entries in the mount table match different prefixes of the filename the one that matches the longest prefix is chosen. ( e.g. /usr/home instead of /usr where both exist in the mount table and both match the desired file. )
  • UNIX uses special device files, usually located in /dev, to represent and access physical devices directly.
    • Each device file has a major and minor number associated with it, stored and displayed where the file size would normally go.
    • The major number is an index into a table of device drivers, and indicates which device driver handles this device. ( E.g. the disk drive handler. )
    • The minor number is a parameter passed to the device driver, and indicates which specific device is to be accessed, out of the many which may be handled by a particular device driver. ( e.g. a particular disk drive or partition. )
  • A series of lookup tables and mappings makes the access of different devices flexible, and somewhat transparent to users.
  • Figure 13.13 illustrates the steps taken to process a ( blocking ) read request:

Figure 13.13 - The life cycle of an I/O request.