How to transfer data in DMA mode under Linux system

  

We all know that using DMA to transfer data can take up less CPU resources, so like other operating systems, Linux supports hard disk to transfer data in DMA mode, but in The default option for DMA when installing Red Hat is Disable, although you can enable it at install time. If the DMA is disabled during installation, how can I activate DMA? DMA support can be activated by recompiling the kernel, but compiling the kernel is obviously too complicated for the novice. The following method activates DMA support without compiling the kernel.

a, DMA inspection system option has been activated

before operation, to verify that the hardware is already in the data transfer using the DMA. Method: Look at the /proc/ide/hda/settings file, where there is a line of content: using_dma, if the value after it is set to 1 means that the system already supports DMA, then the following operations can be avoided, of course if If you want to turn off the DMA function, you have to look down 哟 :).

The hdparm command in Linux is used to perform operations related to the hard disk. Use hdparm -i /dev/hda to list the DMA modes that the IDE may support, such as:

DMA modes: mdma0 mdma1 mdma2 Udma0 udma1 udma2 udma3 *udma4

Second, activate DMA support

Method 1: Add lide=dma in lilo.conf, where x represents the hard disk serial number, its value range is 0-3 Represents four IDE hard disk devices in the system.

Method 2: Use the hdparm command, hdparm d1 /dev/hda where d1 means to enable DMA, you can add it to rc.locl so that the hard disk can use DMA to transfer data every time it starts.

Third, turn off DMA support

Command format: hdparm d0 /dev/hda Close the DMA transfer mode, I really can't think of any reason to do this.

For hard disks that support UDMA transmission, you can also refer to the above methods for setting, but make sure that the hard disk controller and hard disk support UDMA. Finally, you must have a hard disk connection that supports UDMA transmission. Otherwise, even if you UDMA support is activated and it will also strike.

Copyright © Windows knowledge All Rights Reserved