banner



What Are The Advantages And Disadvantages Of Supporting Memory-mapped I/o To Devicecontrol Registers

Operating Organization - I/O Hardware


One of the important jobs of an Operating Arrangement is to manage various I/O devices including mouse, keyboards, bear upon pad, disk drives, brandish adapters, USB devices, Fleck-mapped screen, LED, Analog-to-digital converter, On/off switch, network connections, audio I/O, printers etc.

An I/O arrangement is required to take an awarding I/O request and send it to the physical device, then take whatever response comes back from the device and ship it to the application. I/O devices can be divided into ii categories −

  • Block devices − A cake device is 1 with which the driver communicates by sending entire blocks of data. For case, Hard disks, USB cameras, Disk-On-Key etc.

  • Grapheme devices − A character device is one with which the driver communicates past sending and receiving unmarried characters (bytes, octets). For example, serial ports, parallel ports, sounds cards etc

Device Controllers

Device drivers are software modules that can be plugged into an OS to handle a particular device. Operating Arrangement takes help from device drivers to handle all I/O devices.

The Device Controller works like an interface between a device and a device driver. I/O units (Keyboard, mouse, printer, etc.) typically consist of a mechanical component and an electronic component where electronic component is called the device controller.

In that location is e'er a device controller and a device driver for each device to communicate with the Operating Systems. A device controller may be able to handle multiple devices. As an interface its main task is to convert serial scrap stream to cake of bytes, perform fault correction as necessary.

Any device continued to the computer is connected by a plug and socket, and the socket is connected to a device controller. Following is a model for connecting the CPU, retentivity, controllers, and I/O devices where CPU and device controllers all employ a common bus for advice.

Device Controllers

Synchronous vs asynchronous I/O

  • Synchronous I/O − In this scheme CPU execution waits while I/O proceeds

  • Asynchronous I/O − I/O proceeds meantime with CPU execution

Advice to I/O Devices

The CPU must have a manner to pass information to and from an I/O device. There are iii approaches available to communicate with the CPU and Device.

  • Special Didactics I/O
  • Memory-mapped I/O
  • Straight memory access (DMA)

Special Instruction I/O

This uses CPU instructions that are specifically fabricated for decision-making I/O devices. These instructions typically allow data to be sent to an I/O device or read from an I/O device.

Memory-mapped I/O

When using memory-mapped I/O, the same accost space is shared past memory and I/O devices. The device is continued directly to certain master retentivity locations so that I/O device can transfer block of data to/from memory without going through CPU.

Memory-mapped I/O

While using memory mapped IO, OS allocates buffer in retentiveness and informs I/O device to use that buffer to send information to the CPU. I/O device operates asynchronously with CPU, interrupts CPU when finished.

The advantage to this method is that every didactics which tin access memory can be used to manipulate an I/O device. Retention mapped IO is used for nigh loftier-speed I/O devices similar disks, advice interfaces.

Direct Memory Admission (DMA)

Dull devices like keyboards will generate an interrupt to the main CPU subsequently each byte is transferred. If a fast device such equally a disk generated an interrupt for each byte, the operating organization would spend almost of its time treatment these interrupts. So a typical figurer uses direct memory access (DMA) hardware to reduce this overhead.

Direct Memory Access (DMA) means CPU grants I/O module authorization to read from or write to memory without interest. DMA module itself controls substitution of data between master retentiveness and the I/O device. CPU is only involved at the beginning and stop of the transfer and interrupted only after entire block has been transferred.

Direct Retentivity Access needs a special hardware called DMA controller (DMAC) that manages the data transfers and arbitrates admission to the system passenger vehicle. The controllers are programmed with source and destination pointers (where to read/write the information), counters to track the number of transferred bytes, and settings, which includes I/O and memory types, interrupts and states for the CPU cycles.

DMA

The operating system uses the DMA hardware every bit follows −

Footstep Description
1 Device driver is instructed to transfer deejay data to a buffer accost 10.
2 Device driver so instruct disk controller to transfer data to buffer.
3 Disk controller starts DMA transfer.
four Disk controller sends each byte to DMA controller.
five DMA controller transfers bytes to buffer, increases the memory accost, decreases the counter C until C becomes zero.
6 When C becomes zippo, DMA interrupts CPU to bespeak transfer completion.

Polling vs Interrupts I/O

A reckoner must have a way of detecting the arrival of whatever blazon of input. There are two ways that this can happen, known every bit polling and interrupts. Both of these techniques let the processor to deal with events that tin happen at any time and that are not related to the process it is currently running.

Polling I/O

Polling is the simplest way for an I/O device to communicate with the processor. The process of periodically checking status of the device to see if it is time for the next I/O functioning, is called polling. The I/O device simply puts the information in a Condition register, and the processor must come up and get the data.

Virtually of the time, devices volition non crave attention and when one does it will accept to look until it is side by side interrogated by the polling plan. This is an inefficient method and much of the processors fourth dimension is wasted on unnecessary polls.

Compare this method to a teacher continually asking every student in a class, ane after some other, if they need help. Obviously the more efficient method would be for a student to inform the teacher whenever they require assistance.

Interrupts I/O

An alternative scheme for dealing with I/O is the interrupt-driven method. An interrupt is a point to the microprocessor from a device that requires attention.

A device controller puts an interrupt signal on the bus when it needs CPU's attending when CPU receives an interrupt, Information technology saves its current state and invokes the appropriate interrupt handler using the interrupt vector (addresses of Bone routines to handle various events). When the interrupting device has been dealt with, the CPU continues with its original task as if it had never been interrupted.

Useful Video Courses


Operating System

Video

Essentials of Unix Operating System

Video

CREATE your OWN Operating System from SCRATCH

Video

Arduino with Robot Operating System (ROS)

Video

Computer Hardware, Operating System and Networking

Video

Computer Hardware, Operating System and Networking (Tamil) - தமிழில்

Video

Source: https://www.tutorialspoint.com/operating_system/os_io_hardware.htm

Posted by: kelleyinack1988.blogspot.com

0 Response to "What Are The Advantages And Disadvantages Of Supporting Memory-mapped I/o To Devicecontrol Registers"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel