14 Dec 2019

  • December 14, 2019
  • Amitraj
Input and Output

• The Linux device-oriented file system accesses disk storage
through two caches:

–> Data is cached in the page cache, which is unified with the
virtual memory system
–> Metadata is cached in the buffer cache, a separate cache
indexed by the physical disk block.

• Linux splits all devices into three classes:
–> block devices allow random access to completely
independent, fixed size blocks of data
–> character devices include most other devices; they don’t
need to support the functionality of regular files.
–> network devices are interfaced via the kernel’s networking
subsystem



Block Devices

• Provide the main interface to all disk devices in a system.

• The block buffer cache serves two main purposes:

–> it acts as a pool of buffers for active I/O
–> it serves as a cache for completed I/O

• The request manager manages the reading and writing of
buffer contents to and from a block device driver



Character Devices

• A device driver which does not offer random access to fixed
blocks of data.

• A character device driver must register a set of functions which
implement the driver’s various file I/O operations.

• The kernel performs almost no preprocessing of a file read or
write request to a character device, but simply passes on the
request to the device.

• The main exception to this rule is the special subset of
character device drivers which implement terminal devices, for
which the kernel maintains a standard interface.


Translate

Popular Posts