DMA

来自Ubuntu中文
跳到导航跳到搜索

DMA


原文出处:https://help.ubuntu.com/community/DMA

原文作者:UbuntuWiki

授权许可:

翻译人员:韦涛 MillenniumDark

校对人员:leal MillenniumDark bentusi

贡献者:

适用版本:

文章状态:等待校对


Introduction

介绍

If you experience jumpy DVD playback, slow CD ripping, or a general slow down when accessing optical drive(s) it may be because DMA is not enabled. DMA, or Direct Memory Access, lets hard drives and CD/DVD drives access the system memory.

如果你播放DVD时跳桢,CD抓轨很慢,或是存取光存贮器很慢,也许是因为没有开启DMA功能的缘故。DMA(Direct Memory Access)的中文含意是直接内存访问,可以让硬盘和光驱直接存取系统内存数据。

Ubuntu 6.06 (Dapper Drake) has DMA automatically enabled for drives that support it.

Ubuntu 6.06 (Dapper Drake)能自动为支持的驱动器开启DMA。

attachment:IconsPage/IconDialog-Warning1.png 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.

attachment:IconsPage/IconDialog-Warning1.png 警告:开启DMA功能在某些情况下会造成危险。一般来说问题都和下列原因直接相关:有缺陷的硬件、编写质量糟糕的驱动程序,或者使用了你的系统不支持的设置。

USING HDPARM INCORRECTLY CAN CAUSE MAJOR DATA CORRUPTION AND/OR LOSS. Most systems newer than 4 years support DMA.

不正确的使用HDPARM可以造成存储介质的损坏及/或丢失。最近4年内的系统支持DMA。

Enabling DMA

开启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.

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

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

  • See the what the settings are on /dev/hdc
    • 检查/dev/hdc 上的设置
sudo hdparm /dev/hdc
  • 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.
    • 如果你看到下面的显示: using_dma = 1 (on),那代表DMA已经开启了。请转至第四步来检测它是否在启动的时候已经开启了。
  • Enable DMA on /dev/hdc
    • 开启 /dev/hdc 上的DMA
sudo hdparm -d1 /dev/hdc
  • 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. To do this use this command:
    • 现在你已经为你的驱动器开启了DMA功能。然而,为了在启动的时候让你的设置自动的生效,你需要编辑/etc/hdparm.conf这个文件。使用命令:
      • sudo gedit /etc/hdparm.conf

Add the following to the end of your hdparm.conf 把下列内容添加到你的hdparm.conf文件中。

/dev/hdc {
dma = on
}

(another way of avoiding editing of the hdparm.conf file is to simply run sudo hdparm -d1 -k1 /dev/hdc to keep the DMA flag).

FIXME翻译以上部分。

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 an "Operation Not Permitted" message. You can fix this by editing the file /etc/modules: For an Intel CPU put the lines

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

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

piix
ide-core

above the line

放在 ide-cd 之上

For an AMD CPU put the line

对于一个AMD的微处理器: 把 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 further options that may be more risky. They can be seen using the man hdparm command in the terminal.

FIXME翻译以上部分。

For a detailed description of DMA visit the IEEE

对于详细的DMA描述,请浏览IEEE的网站:

http://standards.ieee.org/reading/ieee/std_public/description/busarch/1212.1-1993_desc.html

IDE, EIDE and UDMA

以及IDE, EIDE and UDMA的网站: