编程(轮询)I / O,中断驱动I / O和直接内存访问之间有什么区别。这些形式的I / O操作系统是否依赖? [英] What is the difference between programmed (polled) I/O, Interrupt-driven I/O, and Direct Memory Access. Are these forms of I/O OS dependent?

查看:1706
本文介绍了编程(轮询)I / O,中断驱动I / O和直接内存访问之间有什么区别。这些形式的I / O操作系统是否依赖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人能够清楚地解释这3种I / O之间的差异,我将不胜感激。另外,我想知道这些形式的I / O是否依赖于操作系统?

I would appreciate it if someone could give a clear explanation of the differences between these 3 types of I/O. In addition, I was wondering if these forms of I/O are OS dependent?

我已经阅读了问题 dma vs中断驱动的i / o ,但回复都不清楚且矛盾。至少对我(对这些概念不清楚的人)来说,这个问题似乎没有明确答案。

I've read through the question dma vs interrupt-driven i/o, but the responses are both unclear and contradictory. At least to me (someone who is unclear about the concepts), there doesn't seem to be a clear answer to the question.

谢谢。

推荐答案

轮询(或编程)I / O:CPU手动检查是否有定期提供的I / O请求。如果没有,它将继续执行其正常的工作流程。如果有,它会处理IO请求。

Polled (or programmed) I/O: The CPU manually check if there are any I/O requests available periodically. If there isn't, it keeps executing its normal workflow. If there is, it handles the IO request instead.

中断驱动的I / O:CPU不需要手动检查IO请求。当有可用的I / O请求时,立即使用中断通知CPU,并使用中断服务程序立即处理请求。

Interrupt-Driven I/O: The CPU doesn't need to manually check for IO requests. When there is an I/O request available, the CPU is immediately notified using interrupts, and the request is immediately handled using a interrupt service routines.

DMA:DMA的使用允许使用中断驱动的IO。否则,如果DMA不可用,系统必须使用编程的I / O.

DMA: The use of DMA allows interrupt-driven IO to be used. Otherwise, a system must use programmed I/O if DMA is not available.

DMA是一种允许设备(通常具有非常慢的I / O速度)访问主存储器而无需CPU显式处理请求的方法。当CPU启动从IO设备到主存储器的数据传输时,CPU指示DMA控制器处理此任务。然后,CPU将忘记此操作,并继续执行其他任务。当DMA控制器完成传输时,它将使用中断向CPU发出信号。然后,CPU将结束与其启动的数据传输相关的任务。

DMA is a method allowing devices (typically has very slow I/O speeds) to access main memory without needing the CPU to explicitly handle the requests. When the CPU initiates data transfer from IO devices to main memory, the CPU instructs the DMA controller to handle this task. The CPU will then "forget" about this operation, and proceed with other tasks. When the DMA controller has completed the transfer, it will signal the CPU using an interrupt. The CPU will then "conclude" the task needed associated with the data transfer it initiated.

DMA和中断驱动的IO的可用性取决于物理CPU。如果存在DMA和中断硬件,则OS(和您的程序)可以使用中断驱动器IO请求。否则,必须通过轮询定期手动检查I / O请求。

The availability of DMA and interrupt driven IO depends on the physical CPU. If the DMA and interrupt hardware exists, then the OS (and your programs) can use interrupt-drive IO requests. Otherwise, I/O requests must be manually checked periodically by polling.

这篇关于编程(轮询)I / O,中断驱动I / O和直接内存访问之间有什么区别。这些形式的I / O操作系统是否依赖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆