13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

148 Transput Chapter 5comes from spooling systems, in which printer output is actually sent to a disk to wait forthe printer to become available.For the kernel to provide transparency and virtual devices, it must deal with physicaldevices without interference from processes. Therefore, all machine instructions thatmight affect devices, such as a ‘‘Start transput’’ instruction, are disabled when the computeris in non-privileged state. A process that uses such an instruction causes a trap tothe kernel, which treats this event either as an error in the process (invalid instruction) oras a request for the kernel to provide transput services itself (service call).In return for this monopoly over physical devices, the kernel provides service callsfor transput (such as reading a block from a tape) and device control (such as rewindingthe tape drive). The kernel usually attempts to schedule transput so that it overlaps withcomputation, possibly blocking the requesting process until the transput completes. Itcan also schedule competing transput requests from different processes so that they areexecuted in an efficient order.<strong>An</strong> amazingly large proportion of the instructions in the kernel, often 50 percent, isdevoted to device handling. Even though the subject has not been formalized very well,the sheer bulk of transput program in kernels makes this subject vital to a study of operatingsystems. Our discussion will begin at the lowest level, the hardware, and will end atthe highest level of software. We will start by describing transput devices. Then we willsee the device interface, that is, the way devices are connected to the computer. Wethen turn to device drivers, which are kernel modules that interact with these devices.Finally, we will discuss the process interface through which processes gain access totransput services from the kernel.1 DEVICE HARDWAREA great number of devices have been designed for computers. Some, like disks anddrums, are used for backing and secondary store. (We use backing store to holdswapped-out parts of virtual store. We use secondary store to hold files that are to bekept after a process terminates.) Tapes are intended for archival store — that is, to holdlarge amounts of data that will not be needed for a long time. Tapes are also used fortemporary store when algorithms require enormous amounts of data and for transferringlarge amounts of information between computer installations. Keyboards and videodisplays, together called ‘‘terminals,’’ allow users to interact with their processes. Specialdevices, like robot arms and television cameras, are used for real-time control. Communicationlines connect computers and peripherals.We cannot hope to give a complete description in this book of all these devices.Instead, we will present general principles and concentrate on just a few devices.1.1 Disks

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!