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 your multiprocessor supporting. 

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/hda  for enable DMA
        hdparm -d0 /dev/hda  for disable DMA

3. The parameter -X [16~18, 32~34, 64~70] 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/hda  for UDMA 6

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