Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  In DOS versions 2.0 and later, you can write a routine that provides a
  consistent interface between DOS's handle-based I/O functions and almost
  any I/O device that can input or output a stream of data. Such a routine
  is called a device driver. DOS comes with several built-in device drivers
  for the keyboard, video display, printer, communications port, and disks.
  You can also install device drivers for other devices by including their
  names in DEVICE commands in the CONFIG.SYS file.

  DOS I/O device drivers allow handles to be associated not only with disk
  files but with any input/output device. When you use a handle-based DOS
  function to open a device, DOS searches its list of device drivers before
  it searches for a disk filename. Familiar names like "CON", "LPT1", and
  "NUL" are all part of the default list of device drivers. Opening a device
  for input/output thus consists only of passing a name to a DOS function
  and receiving a handle from DOS in return, regardless of whether the
  device is a disk file or is associated with some other type of hardware.

  --------------------------------------------------------------------------
  NOTE:
    Incidentally, this explains why you can't open a file named "CON" or
    "PRN": DOS searches for device names before it searches for filenames,
    so it always finds a named device before it finds a file with the same
    name.
  --------------------------------------------------------------------------

  You don't have to know much about the implementation of device drivers to
  use the handle-based DOS functions, so we will save a more detailed
  discussion of device drivers for Appendix A. Keep in mind that by placing
  the discussion of device drivers at the end of the book, we in no way mean
  to diminish their importance. All programmers concerned with the range and
  longevity of their programs should at least be familiar with the use and
  operation of DOS device drivers.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson