xinjian 发表于 2002-11-21 20:56:30

如何打开硬盘的DMA方式

我按照贴子上的方法远行hdparm -d1 /dev/hda无法打开DMA方式显示:
setting using_dma to 1 (on)
HDIO_SET_DMA failed:Operation not permitted
using_dma=0(off) :?:

llc 发表于 2002-11-21 22:08:18

会不会你的hda其实是光驱?
你用fdisk -l看看你的硬盘究竟是哪个盘

xinjian 发表于 2002-11-21 22:15:56

确实是hda,光驱是hdc,而且光驱也打不开DMA方式。

shuishou 发表于 2002-11-21 22:16:23

你用的是那一个版本的linux?
是不是redhat7。3以前的版本,如果是的话,应该到via的网站下一个补丁,按照它的说明做就可以了。不过要编译内核,有一些麻烦,建议升级到redhat8。0。

xinjian 发表于 2002-11-22 12:39:08

我装的是红旗3.2版。请问该如何打开。

llc 发表于 2002-11-22 12:53:09

如果你的主板是威盛的话,估计得打补丁编译内核了

吴文官 发表于 2002-11-22 13:03:25

试一下这个贴子的方法
http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=5405&start=0&postdays=0&postorder=asc&highlight=DMA

xinjian 发表于 2002-11-22 17:34:58

我确实是via主版,而且我也在via网站下载了补丁,readme是英文,但我边查字典边作,但还有几处不明白,希望各位高手指点!我把原文贴出来。
This README file describes how to patch IDE driver source file,
rebuild the Linux kernel, and measure IDE performance.

Step I: Patch the Linux IDE driver source file
1. The Linux kernel including driver source files are all placed in
   the directory /usr/src/linux. You have to change your directory
   /usr/src in your console.

      #cd /usr/src

2. Before patching your Linux IDE source file, you should decompress
   your patch file.

      #gunzip xxx-patch-xxx-vpide.gz

3. And then you will find a file "xxx-patch-xxx-vpide" in the current
   directory. This file is a patchfile that the Linux utility "patch"
   can read.

      #patch -p0 <xxx-patch-xxx-vpide

   Note: Setting parameter -p0 gives the entire file name unmodified.

Step II: Rebuild the Linux kernel
1. Change the current directory to /usr/src/linux

      #cd linux

2. Configure the system. The system will ask about driver settings.

      #make xconfig

   Note: If you are in text mode, try "make menuconfig".

3. The system will pop up a "Linux configuration window" window
   with many driver buttons. Find out the button "ATA/IDE/MFM/RLL support"
   and press it. Press the button "IDE,ATA and ATAPI Block devices".
   The system will pop up another window. Select "VIA82CXXX chipset support".

   Note: Pay attention to your CPU type and check if your system
         supports multiple processors. If your system is a uni-processor
         system, disable the multiprocessor support.

4. Find out the dependencies of source files and the system will
   build a new Makefile.

      #make dep
         
5. If you used to build Linux kernel, you should clean old object
   files and force building new kernel.

      #make clean

6. And you can build a new kernel image.

      #make bzImage

7. It is also possible to "make install", if you have lilo installed
   to suit your kernel makefile.

8. Then you have to check /etc/lilo.conf to see if the image point
   to /boot/vmlinuz. On the other hand, there must be the line
   "image=/boot/vmlinuz" in your lilo.conf.

9. Run "lilo" command in your current directory and you will see
   the prompt "Added linux *".

10. Reboot Linux system. You will see the boot message shown below
    if using the south bridge vt8233a.
   
    "VP_IDE: vt8233a (rev 00) IDE UDMA133 Controller on pci:slot-num"
   
Step III: Measure IDE performance
Use the "hdparm" utility to test IDE performance. The utility
provides a command line interface to various hard disk ioctls
supported by the device driver. The following options are available
for how to enable/disable DMA, change the UDMA mode, and measure
the data transfer throughput.

1. The parameter -T is essentially to measure the throughput of the
   processor, cache, and the memory of the system, -t is to measure
   how fast the drive can sustain sequential data reads.

    eg: hdparm -tT /dev/hda

2. The parameter -d1 is to enable DMA mode, -d0 is to disable DMA mode.

    eg: hdparm -d1 /dev/hdafor enable DMA
      hdparm -d0 /dev/hdafor disable DMA

3. The parameter -X is to switch the transfer mode,
   16~18 for SDMA 0~2, 32~34 for MDMA 0~2, 64~70 for UDMA 0~6.

    eg: hdparm -X70 /dev/hdafor UDMA 6

4. The parameter -i to check the current transfer mode.

我对Step II下的5、6、7、8、9不太明白,请各位高手祥细指点。
                     

                                 先谢谢大家!!!

llc 发表于 2002-11-22 18:24:04

上次有位朋友也有这个问题,他也是重新编译内核就搞定的,不过,不推荐在红旗系列上重新编译内核,因为他们的内核是hack过的,但源码里不一定放上hack过的地方,因此,重新编译的内核可能让你失去一些红旗特有的功能

如果有条件的话,建议试试rh8

mwatt 发表于 2002-11-22 22:02:52

make clean的意思好像是清理无用的文件,防止把某些文件(过期的)编译进内核,这样会导致内核变大或是出现错误。
make bzImage是建立内核镜像
第8:
就是让系统引导是采用那个内核镜像。我的RH7。3上在make bzImage之后,在/boot目录想会出现vmlinuz等几个文件,是几个连接文件指向你新编译出的内核镜像。原来的内核镜像一般是vmlinuz2.4.18-3 之类的,你需要在你的引导配置文件中,把它改为新的文件。因为我用GRUB,所以只说GRUB了,我建议你新加一个title,这样如果新内核出错的话,你还可以用旧内核启动。具体参见GRUB的配置,在系统安装中刚有这篇帖子。
页: [1]
查看完整版本: 如何打开硬盘的DMA方式