[wiki]DMA

参与到Ubuntu的翻译中来
回复
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

[wiki]DMA

#1

帖子 oneleaf » 2005-09-12 12:05

If you experience jumpy DVD playback, it may be because DMA is not enabled. DMA, or Direct Memory Access, lets hard drives and CD/DVD drives access the system memory.

Warning: Enabling DMA can be dangerous in some cases. Usually issues are directly related to faulty hardware, poorly written drivers, or using settings that are unsupported by your system. USING HDPARM INCORECTLY CAN CAUSE MAJOR DATA CORRUPTION AND/OR LOSS. Most systems newer than 3 years support DMA.
Enabling DMA

To enable DMA, you need to use the hdparm command and the configuration file hdparm.conf.

These instructions assume that you are trying to enable DMA on hdc, usually the CD-rom drive.

1.

See the what the settings are on /dev/hdc
*

sudo hdparm /dev/hdc


2.

If you get a line like using_dma = 1 (on), DMA is already enabled. Skip to step 4 to see if it has been enabled at boot time.
3.

Enable DMA on /dev/hdc
*

sudo hdparm -d1 /dev/hdc


4.

You have now enabled DMA for the drive. However, in order for the settings to be automatically applied at boot there you need to edit the /etc/hdparm.conf} script. Add the following to the end of your hdparm.conf
*

/dev/hdc {
dma = on
}


Troubleshooting

If your drives are configured in [Cable Select] mode and while running hdparm commands you receive errors related to timeouts or drive not ready, try changing the drive to be a master or slave device depending on your system configuration. This does require opening the case and as far as I know most drives are set to Cable Select from the manufacturer.

Sometimes step 3 above can fail with a "operation not permitted" message. You can fix this by editing the file /etc/modules: For an intel cpu put the lines

piix

ide-core

above the line

ide-cd

For an amd cpu put the line

amd74xx

above

ide-cd

For a VIA Chipset put

via82cxxx

above

ide-cd

Then reboot and try steps 3-4 again....
Further reading

The hdparm has a further options that may be more risky. They can be seen using the man hdparm command in the terminal.

For a detailed description of DMA visit the IEEE [WWW] http://standards.ieee.org/reading/ieee/ ... _desc.html

IDE, EIDE and UDMA [WWW] http://www.spcug.org/reviews/bl0108.htm


https://wiki.ubuntu.com/DMA
当净其意如虚空,远离妄想及诸取,令心所向皆无碍
韦涛
帖子: 27
注册时间: 2005-06-16 5:29

#2

帖子 韦涛 » 2005-09-12 14:21

如果你经历过DVD播放时跳桢,这也许是因为没有开启DMA功能的缘故。DMA(Direct Memory Access),中文含意是:直接内存访问,可以让硬件驱动和光驱访问系统的内存。

警告:开启DMA功能在某些情况下会造成危险。一般来说问题都和下列原因直接相关:有缺陷的硬件、编写质量糟糕的驱动程序,或者使用了你的系统不支持的设置。不正确的使用HDPARM可以造成存储介质的损坏及/或丢失。最近3年内的系统支持DMA。


开启DMA

为了开启DMA,你需要使用hdparm命令和配置文件hdparm.conf。

这个指导假定你正在尝试开启hdc上的DMA,通常是光盘驱动器。

1. 检查/dev/hdc 上的设置

代码: 全选

sudo hdparm /dev/hdc 
[/color]


2. 如果你看到下面的显示: using_dma = 1 (on),那代表DMA已经开启了。请转至第四步来检测它是否在启动的时候已经开启了。

3. 开启 /dev/hdc 上的DMA

代码: 全选

sudo hdparm -d1 /dev/hdc 

4. 现在你已经为你的驱动器开启了DMA功能。然而,为了在启动的时候让你的设置自动的生效,你需要编辑/etc/hdparm.conf这个文件。把下列内容添加到你的hdparm.conf文件中。

代码: 全选

/dev/hdc { 
dma = on 
} 

疑难解答

如果你的驱动器配置为 [Cable Select]模式,并且在使用hdparm命令时得到了类似于超时或者驱动没有就绪的错误,那么请尝试根据你的系统配置把驱动器改为主设备或者辅设备。这么做就得打开机箱,并且据我所知,大部分驱动器被生产厂家默认的设置为Cable Select 模式。


有时候上面的第三步会出现“操作不被允许”的错误信息。你可以通过编辑/etc/modules这个文件来修补它。
对于一个英特尔微处理器:

代码: 全选

piix 
ide-core

放在

代码: 全选

ide-cd 
之上

对于一个AMD的微处理器:

代码: 全选

amd74xx 
放在

代码: 全选

ide-cd
之上

对于一个威胜芯片组:

代码: 全选

via82cxxx

放在

代码: 全选

ide-cd

之上

然后重新启动系统,重复第三步和第四步

进一步的阅读

hdparm还有一个更危险的选项。可以通过使用命令

代码: 全选

man hdparm
在终端了解到[/color]

对于详细的DMA描述,请浏览IEEE的网站:http://standards.ieee.org/reading/ieee/ ... _desc.html
以及IDE, EIDE and UDMA的网站:http://www.spcug.org/reviews/bl0108.htm
上次由 韦涛 在 2005-09-12 16:17,总共编辑 4 次。
头像
leal
帖子: 1119
注册时间: 2005-08-29 14:49
来自: 杭州
联系:

#3

帖子 leal » 2005-09-12 14:38

警告:开启DMA功能在某些情况下会造成危险。通常的issues是直接和错误的硬件,很差的写入驱动联系或者使用了你的系统并不支持的设置。不正确的使用HDPARM可以造成存储介质的损坏和/或者丢失。最近3年内的系统支持DMA。

警告:开启DMA功能在某些情况下会造成危险。一般来说问题都和下列原因直接相关:有缺陷的硬件、编写质量糟糕的驱动程序,或者使用了你的系统不支持的设置。不正确的使用HDPARM可能导致严重的数据损坏及/或丢失。最近3年内的系统支持DMA。
用心×恒 | 豆瓣 | 门户 | Blog
韦涛
帖子: 27
注册时间: 2005-06-16 5:29

#4

帖子 韦涛 » 2005-09-12 14:48

:D 多谢leal的指正!
韦涛
帖子: 27
注册时间: 2005-06-16 5:29

#5

帖子 韦涛 » 2005-09-12 14:51

This does require opening the case
这句话 不知道 该怎么翻译 了 :(
头像
leal
帖子: 1119
注册时间: 2005-08-29 14:49
来自: 杭州
联系:

#6

帖子 leal » 2005-09-12 15:08

韦涛 写了:
This does require opening the case
这句话 不知道 该怎么翻译 了 :(
即作者在上一句提到如要 try changing the drive to be a master or slave device depending on your system configuration,即驱动器改成主或从设备,则 这么做就得打开机箱(因为要换数据线插口),不过作者在后面提到,就他所知,目前大部分设备制造商……如何如何
用心×恒 | 豆瓣 | 门户 | Blog
头像
yang119345
帖子: 570
注册时间: 2005-06-19 14:22
来自: 上海
联系:

#7

帖子 yang119345 » 2005-09-14 1:49

:shock: leal的英文真的了的 :o
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#8

帖子 oneleaf » 2005-09-22 23:01

头像
millenniumdark
论坛版主
帖子: 4159
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
联系:

#9

帖子 millenniumdark » 2006-07-30 14:36

英文有新版本出来了

改动不是很大

校对了一下,新增了一点点翻译

等待接手

http://wiki.ubuntu.org.cn/DMA
回复