<< Chapter < Page | Chapter >> Page > |
In simple systems, the CPU must move each data byte to or from the bus using a LOAD or STORE instruction, as if the data were beingmoved to memory. This quickly uses up much of the CPU's computational power. In order to allow systems to support high I/O utilization while the CPU is gettinguseful work done on the users' behalf, devices are allowed to directly access memory. This direct access of memory by devices (or controllers is called DirectMemory Access, commonly abbreviated DMA).
The CPU is still responsible for scheduling the memory accesses made by DMA devices, but once the program has been established,the CPU has no further involvement until the transfer is complete. Typically DMA devices will issue interrupts on I/O completion.
Because this memory is not being manipulated by the CPU, and therefore addresses may not pass through an MMU, DMA devices oftenconfuse or are confused by virtual memory. It is important to guarantee thatmemory intended for use by a DMA device is not manipulated by the paging system while the I/O is being performed. Such pages are usually frozen (or pinned) toavoid changes.
In some sense DMA is simply an intermediate step to general purpose programmability on devices and device controllers. Several suchsmart controllers exist, with features ranging from bit swapping, to digital signal processing, checksum calculations, encryption and compression and generalpurpose processors. Dealing with that programmability requires synchronization and care. Moreover, in order for code to be portable, writing an interface tosuch smart peripherals is often a delicate balancing act between making features available and making the device unrecognizable.
The I/O software of the OS has several goals:
Notification Switch
Would you like to follow the 'Operating systems' conversation and receive update notifications?