Solved

Measure my hard disk speed

Posted on 1997-06-06
4
312 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops 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.

932 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now