Pages

Thursday, 19 September 2013

Device Management

A process may need several resources to execute—main memory, disk drives,
access to files, and so on. If the resources are available, they can be granted,
and control can be returned to the user process. Otherwise, the process will
have to wait until sufficient resources are available.
The various resources controlled by the operating sysstem can be thought
of as devices. Some of these devices are physical devices (for example, tapes),
while others can be thought of as abstract or virtual devices (for example,
files). If there are multiple users of the system, the system may require us to
first request the device, to ensure exclusive use of it. After we are finished
with the device, we release it. These functions are similar to the open and
close system calls for files. Other operating systems allow unmanaged access
to devices. The hazard then is the potential for device contention and perhaps
deadlock, which is described in Chapter 7.
Once the device has been requested (and allocated to us), we can read,
write, and (possibly) reposition the device, just as we can with files. In fact,
the similarity between I/O devices and files is so great that many operating
systems, including UNIX, merge the two into a combined file-device structure.
In this case, a set of system calls is used on files and devices. Sometimes,
I/O devices are identified by special file names, directory placement, or file
attributes.
The UI can also make files and devices appear to be similar, even though
the underlying system calls are dissimilar. This is another example of the many
design decisions that go into building an operating system and user interface.

No comments:

Post a Comment