个人工具

UbuntuHelp:DMA

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 11:49的版本 (New page: {{From|https://help.ubuntu.com/community/DMA}} {{Languages|php5}} === Introduction === If you experience jumpy DVD playback, slow CD ripping, or a general slow down when accessing optical...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索


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.

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

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.

USING HDPARM INCORRECTLY CAN CAUSE MAJOR DATA CORRUPTION AND/OR LOSS. Most systems newer than 4 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
   </code>
 1. If you get a line like <code> using_dma    =  1 (on)</code>, DMA is already enabled. Skip to step 4 to see if it has been enabled at boot time.
 1. Enable DMA on `/dev/hdc`
   <pre>
   sudo hdparm -d1 /dev/hdc
   </code>
 1. 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 <code>/etc/hdparm.conf</code> script. To do this use this command: <code>gksudo gedit /etc/hdparm.conf</code>

Add the following to the end of your hdparm.conf
<pre>
/dev/hdc {
dma = on
}
</code>

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

=== 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
<pre>
piix
ide-core
</code>
above the line
<code>ide-cd</code>

For an AMD CPU put the line
<code>amd74xx</code>
above
<code>ide-cd</code>

For a VIA Chipset put
<code>via82cxxx</code>
above
<code>ide-cd</code>

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 <code>man hdparm</code> command in the terminal.

For a detailed description of DMA visit the IEEE 
http://standards.ieee.org/reading/ieee/std_public/description/busarch/1212.1-1993_desc.html

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

----
CategoryDocumentation

[[category:UbuntuHelp]]