Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Measure my hard disk speed

Posted on 1997-06-06
4
316 Views
Last Modified: 2013-11-15
Hello, I know a little bit about C, I would like to have a source code in C (and the bynary too) that I can use to measure my hard disk speed (and probably another knid of hardware).

Can any of you help me please?.
0
Comment
Question by:aacosta
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
Slarti earned 90 total points
ID: 1251001
First, the problems:
There is no way to know the exact speed of your hard disk. This is because factors such as disk caching (both software and hardware) cause actual transfer rates to vary from the expected values. Programs like Norton Utilities' SysInfo regularly give results which are about 2-3 ms faster than the actual speed. If you really want to find out what your disk speed is, the best way is to either open up the computer and look at it (most disks have this info written on them, along with some other technical details), or look it up in the hard disk's spec sheets (which can probably be found online, and should also have come with your hard disk).

But, if you still want to code a program that will measure disk speed (for instance as part of a program like SysInfo), here's what you need to know:
Disk speeds are measured by two factors: sequential speed and random-access speed. Sequential speeds are mostly affected by the disk transfer rate (which is also a function of the controller). They are basically the amount of time you wait between two sector reads when the two sectors come one after the other. I.e., the disk doesn't have to spin very much to get to the next sector, which is why this speed depends mostly on the trasnfer rate.
Random-access speed is the average amount of time you wait between two sector reads when the sectors are chosen randomly (as opposed to being one after the other). On the average, the amount of time you will have to wait is equal to the amount of time the disk takes to rotate by 180 degrees.
To do these tests, you will first have to find the number of sectors in the hard disk. The interrupts INT 41h and INT 46h are good for this purpose if you have an IDE. (Technical info about these interrupts can be found at http://www.ctyme.com/intr/rb-5790.htm).
You will then need to read sectors as described above. You can use the BIOS Int 13h, function 0Ah to do this (info about this interrupt at http://www.ctyme.com/intr/rb-0546.htm).

You should probably perform the tests many times (say 100 or so), so that the timing will be more accurate. Remember the PC timer only has an accurate of 1/55 sec.

If the above interrupt talk is above your level (you said you know "a little bit about C"), there are C functions defined in DOS.H which can be used to generate interrupts. (Do this in DOS mode - in Windows there are zillions of other factors affecting hard disk performance). The geninterrupt() function is an example. However, remember that interrupts reach right down into the heart of the computer and start messing around with what they find there, so novice programmers should be careful with these functions, especially when they involve disk access. However, if you do want to measure the actual disk speed, this is the way to do it.
0
 
LVL 1

Author Comment

by:aacosta
ID: 1251002
Excellent, your answer was great. I gonna try everything what you say, but if you can send my a C code to aacosta@c-com.net
it would be great.

Thanks.
0
 
LVL 1

Author Comment

by:aacosta
ID: 1251003
Excellent, your answer was great. I gonna try everything what you say, but if you can send my a C code to aacosta@c-com.net
It would be great.

Thanks.
0
 
LVL 1

Author Comment

by:aacosta
ID: 1251004
Hello, again, I've been trying to use the interrupts you suggested me but my computer always hang up (I have not damage anything).
Do you know someone or somewhere I can find the source code I need?
Thanks again, bye.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to set up a document for the web and print and the recommended PPI for printing.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question