Device Management
The path
between the operating system and virtually all hardware not on the
computer's motherboard goes through a special program called a
driver. Much of a driver's function is as translator between
the electrical signals of the hardware sub-systems and the
high-level programming languages of the operating system and
application programs. Drivers take data that the operating system
has defined as a file and translate them into streams of bits placed
in specific locations on storage devices, or a series of laser
pulses in a printer.
Because there are such wide differences in the hardware
controlled through drivers, there are differences in the way that
the driver programs function, but most are run when the device is
required, and function much the same as any other process. The
operating system will frequently assign high priorities blocks to
drivers so that the hardware resource can be released and readied
for further use as quickly as possible.
One reason that drivers are separate from the operating system is
so that new functions can be added to the driver-and thus to the
hardware subsystems-without requiring the operating system itself to
be modified, recompiled and redistributed. Through the development
of new hardware device drivers, development often performed or paid
for by the manufacturer of the subsystems rather than the publisher
of the operating system, input/output capabilities of the overall
system can be greatly enhanced.
Managing input and output is largely a matter of managing queues
and buffers, special storage facilities that take a stream of bits
from a device, from keyboards to serial communications ports,
holding the bits, and releasing them to the CPU at a rate slow
enough for the CPU to cope with. This function is especially
important when a number of processes are running and taking up
processor time. The operating system will instruct a buffer to
continue taking input from the device, but to stop sending data to
the CPU while the process using the input is suspended. Then, when
the process needing input is made active once again, the operating
system will command the buffer to send data. This process allows a
keyboard or a modem to deal with external users or computers at a
high speed even though there are times when the CPU can't use input
from those sources.
Managing all the resource of the computer system is a large part
of the operating system's function and, in the case of real-time
operating systems, may be virtually all the functionality required.
For other operating systems, though, providing a relatively simple,
consistent way for applications and humans to use the power of the
hardware is a crucial part of their reason for existing.