OS - Chapter 7
OS - Chapter 7
Network card
Disk controller
DVD-ROM controller
USB
Serial port
Sound card
MEMORY MAPPED I/O
• It is the communication method among CPU, Memory and I/O
• This configuration uses same bus and same control signals but unique
address space between memory and I/O. Same address space is
shared by memory and I/O devices. But some addresses represent
memory cells, while others represents registers in I/O devices
• In this mechanism, whenever the CPU generates the memory
request. Even the control signals are matching but address space is
Image source : Google
not matching therefore only one node can perform the operation.
MEMORY MAPPED I/O
•Same address space is shared by
memory and I/O devices. But some
addresses represent memory cells,
while others represents registers in
I/O devices.
•In this mechanism, whenever the
CPU generates the memory request.
Even the control signals are
matching but address space is not
matching therefore only one node
Image source : Google
can perform the operation.
I/O DEVICE
Advantages of memory mapped I/O:
• It makes programming simpler.
• It does not have special commands to access I/O devices.
Disdvantages of memory mapped I/O:
• Memory utilization is poor.
• It is suitable only when the processor consist the limited numbers of
I/O ports.
Image source : Google
DMA(DIRECT MEMORY ACCESS)
•A special unit may be provided to
allow transfer of block of data directly
between external device and the main
memory, without continuous
intervention by the processor. This
approach is called Direct Memory
Access (DMA).
•This means that once reading and
writing has begun, the remainder of the
data can be transferred to and from
DMA[3]
memory without processor (CPU)
intervention.
DIRECT MEMORY ACCESS
•DMA is particularly useful on devices like
disks, where many bytes of information can
be transferred in single I/O operations.
When used in conjunction with an interrupt,
CPU is notified only after the entire block of
data has been transferred.
•Direct Memory Access is an I/O technique
that allows a control unit to directly access
main memory.Without DMA, the processor
is responsible for the physical movement of
Image source : Google
data between main memory and device.
WORKING OF DIRECT MEMORY ACCESS
•During execution of first part of the user
program, the CPU initializes the DMA with
control signals, IO address, Memory starting
address and the count value. Then the CPU
is busy with execution of the part1(user
program part1). Simultaneously the DMA
initializes the operation to the
corresponding IO device by sending the
DMA request signal. After Preparing the
data, the I/O device sends the DMA ACK
signal to the DMA. DMA Working[5]
WORKING OF DIRECT MEMORY ACCESS
• Whenever the DMA module receives the ACK signal from the IO, it enables the
HOLD signal for the purpose of gain the control of the bus and it is waiting for the
HOLD ACK signal.
• When the processor receives the HOLD signal it enables the HOLD ACK (HLDA)
signal.
• Whenever DMA receives HLDA signal, it transfer the data from the IO device to
memory until the count becomes zero.
• Until transfer the data, the CPU is in the blocked state. After completion of data
transfer operation, the DMA reestablish the bus connection to the CPU.
MODES OF DIRECT MEMORY ACCESS
•Burst mode
•Cycle stealing mode
•Blocked mode
• Buffering: A buffer is a memory area that stores data while they are
transferred between two devices or between a device and an
application.
• Buffering is done for the following reasons One reason is to cope with
a speed mismatch between the producer and consumer of a data
stream.
Image source : Google
I/O DEVICE
Interrupt: Interrupt is unusual event of disturb.
• The CPU hardware has a wire called the interrupt request line that
the CPU senses after executing every instruction.
• The CPU responds to the interrupt only after completion of the
current instruction execution.
1. Fetch cycle
2. Execution cycle
3. Interrupt cycle
• Device Specific: This portion of a device remains the same across all operating
system and is more about understanding and decoding the device data than
software programming. A data sheet for a device is a document with technical
details of the device, including its operation, performance, programming etc.
• OS specific: This portion is tightly coupled with the OS mechanisms of user
interfaces thus differentiates a linux device driver from windows device driver.