Solved

Measure my hard disk speed

Posted on 1997-06-06
4
318 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
[X]
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
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

A list of useful business intelligence software.
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

691 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