Database Reference
In-Depth Information
devices. These addresses are recognized by the memory controller as commands to
I/O devices and do not correspond to memory physical locations. Different memory-
mapped addresses are used for different I/O devices. Lastly, to protect I/O devices,
both I/O instructions and memory-mapped addresses are handled in system mode,
thus becoming privileged.
Because I/O operations are executed in system mode, user programs can only
invoke them through OS system calls (assuming traditional systems). The OS
abstracts most of the details of I/O devices and makes them accessible through only
well-defined interfaces. Figure 16.22 shows the three major interfaces that come into
play when a user program places an I/O request. These are the system call interface ,
the device driver interface , and the operation level interface . Starting an I/O opera-
tion, a user I/O request causes an OS system call that transfers control to the OS.
Next, the OS calls device drivers (a set of software routines) via the device driver
interface. A relevant device driver routine converts the I/O request to an operation
specific to the requested physical device. The converted operation is subsequently
carried through the operation level interface to the corresponding physical device.
16.8.2 v irtualizing i/o D eviCes
I/O virtualization allows a single physical I/O device to be shared by more than
one guest OS. Figure 16.23 demonstrates multiple guest OSs in native system VMs
sharing a single hardware machine. As shown, the hypervisor constructs virtual
devices from physical devices. A main observation is that both the guest OSs and the
hypervisor must have device drivers encapsulating the interfaces to the devices. This
means that with virtualization, two different device drivers must be supported per
each device, versus only one without virtualization [21]. In reality, this is a problem
because vendors of devices usually supply drivers for only the major OSs, but not
for hypervisors (though this could change in the near future). One way to circumvent
such a problem is to co-locate the hypervisor with a major OS (e.g., Linux) on the
same machine. This way, I/O requests can be handled by the OS that holds all the
requisite I/O drivers. This is the approach that Xen adopts and which we detail in
the next section.
Moreover, with I/O virtualization, every I/O request issued by a user program at
a guest VM should be intercepted by the hypervisor. This is because I/O requests
Process
rocess
Process
System calls
OS
Driver calls
Device drivers
I/O calls
Processor(s)
Devices
FIGURE 16.22 The three major interfaces involved in I/O operations, system call, device
driver, and operation-level interfaces.
Search WWH ::




Custom Search