Due: 4/26/05
This lab makes use of the hdparm command under linux. Commands in Linux are fairly straightforward. You type the name of the command followed by any options followed by the parameters of those options. For example, "hdparm /dev/hda" executes the hdparm command on the hard drive specified as /dev/hda. If you are taken the 2601 or 2611 classes then this should look familiar to you.
hdparm is a command that allows us to talk directly to the IDE hard drive driver in Linux and ask it to change settings in that driver. We will use this to instruct the driver to turn DMA on and off. We will then also use this command to execute benchmarking tests to evaluate the performance of moving data to the hard drive with various levels and types of DMA turned on and turned off. We are using Linux to do this instead of windows because:
1) The Windows driver doesn't provide a nice interface for doing this. Thus this way is more flexible.
2) This has the chance of screwing up and causing your machine to hang if an unsupported DMA mode is selected. By doing it on Linux running out of RAM, we can always reboot the machine to restore it to normal without hurting your Windows install on your machine. Thus its safer.
You will need to login to the Linux system as the super user. That account is named "root". If you are in Graphical Mode when the system boots up then you will need to start a command line interpreter so that you can work properly. You can do this by clicking on the picture of the sea shell a the bottom of the screen. That will open up a window with a command line interpreter running in it. While logged in as superuser, you will need to use the hdparm command. You can find detailed info on the command with the man hdparm command. Man is the online manual system for UNIX machines such as Linux.
First you should attempt to determine the default state of the DMA capabilities of the hardware in your laptop. you can do this by typing the command hdparm /dev/hda. this command will show you the default settings for the hard drive controller. An example of that output is:
/dev/hda:
multcount = 16 (on)
IO_support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 30515/255/63, sectors = 251000193024, start = 0
Next we will do the command hdparm -i /dev/hda
/dev/hde:
Model=Maxtor 6Y250P0, FwRev=YAR41BW0, SerialNo=Y637STSE
Config={ Fixed }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=57
BuffType=DualPortCache, BuffSize=7936kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 udma6
AdvancedPM=yes: disabled (255) WriteCache=enabled
Drive conforms to: (null):
* signifies the current active mode
The "-i" option tells hdparm to give all the info about the default settings of the hard drive specified. "/dev/hda" is the hard drive unit named "A". Linux names hard drives differently than windows. Windows names hard drives alphabetically starting at "A". A and B are traditionally floppy drives. C-Z are combinations of hard drives and CD-ROM drives. Since most of you are using hard drives with only one hard disk in them the name of the disk should be "/dev/hda". The command hdparm has many options. You will be using a few of them. You can get the entire list of commands by using the online manual built in to Linux.
The -t option is used to enable testing mode for I/O bandwidth including both the hard drives cache and the actual hard drive media itself. E.g hdparm -t /dev/hda
Udma is Ultra DMA and is used on hard drives that use the ATA33/66 I/O systems
Mdma is multii-word DMA and is used on drives that have multi-word I/O enabled.
You will perform several tests and record the results. You will then compare the results and attempt to explain them.