Google Answers Logo
View Question
 
Q: Source Code for Harddisk Test ( Answered,   0 Comments )
Question  
Subject: Source Code for Harddisk Test
Category: Computers
Asked by: systemspcl-ga
List Price: $2.00
Posted: 03 Sep 2002 04:56 PDT
Expires: 03 Oct 2002 04:56 PDT
Question ID: 61213
source code for Hard disk test
Answer  
Subject: Re: Source Code for Harddisk Test
Answered By: maniac-ga on 03 Sep 2002 17:26 PDT
 
Hello systemspcl,

In answering the question, I will provide alternatives for more than
one type of system. These utilities are generally part of a benchmark
suite or general diagnostic programs.

For Unix systems (or Linux), there is "Unixbench". Described as part
of the Linux Benchmarking HOWTO at...
  http://www.fokus.gmd.de/linux/HOWTO/pdf/Benchmarking-HOWTO.pdf

or you can get the source directly at...
  http://www.tux.org/pub/tux/niemi/unixbench/

For DOS systems, there are a number of disk test utilities at...
  http://www.simtel.net/pub/msdos/diskutil/

though I cannot be sure if source code is included in these utilities.

There is also a disk test included as part of "Membench", an assembly
language utility program for Intel x86 processors and can report 32
bit PCI/VL hard disk read / write rate. This is described at...
  http://www.intelligentfirm.com/membench/membench.html

This has the advantage of being small and includes source code.

Search terms used to find these included...
  "source code" hard "disk test"

If you add your operating systems and/or language of interest, you can
get some more focused links as well.

  --Maniac

Request for Answer Clarification by systemspcl-ga on 06 Sep 2002 21:44 PDT
Hi
We are interested in checking the Harddisk Clusters / Sectors before
starting our critical application where it involves Data Logging. The
idea is if the Hard disk has developed any bad sectors over a period
of usage, the application should terminate.

Here the System (x86 processor) is loaded with Dos OS and the
partition is of FAT16. We have got a source code that is possible to
read the FAT16 table contents. Out of which we want to know how many
sectors / clusters are free or not occupied and if so, we will select
randomly of 100 nos of clusters and write a known pattern to one
sector of each cluster. This we are not able to do as we dont know how
to interpret the FAT 16 table contents. If you have any idea about
this, let me know

-- systemsspcl-ga

Clarification of Answer by maniac-ga on 08 Sep 2002 20:37 PDT
Hello systemspcl,

From your clarification request, I believe you want to verify a
section of disk prior (and make sure your application uses it) prior
to doing data logging.  From your description, you believe the best
way is to interpret the FAT 16 "table contents" so you can check the
freep portions of disk prior to running the data logging program.

I will provide an alternative to what you first stated - verify the
disk prior to running the application. This alternative should be
quite a bit easier to implement unless you cannot change the data
logging application.
 1. create a file to capture the data, make it large enough for all
the data plus some spare space.
 2. read and write the file using a test pattern to verify the area is
OK. This could be a simple application using code similar to your data
logging program (to enhance reuse of your code). It should indicate
success or failure by message and/or error code.
 3. change the data logging program to write to the existing file
instead of creating a new file.

This has the advantage of not requiring any special knowledge of how
disk clusters are organized, is portable to other systems, and gives
you a firm guarantee that the data will be written to a good part of
the disk (as just tested). If the test program has problems, you can
either:
 - not run the data logging application (since the disk is bad)
OR
 - set that file aside as "known bad", create another data logging
file, and repeat the test

If you still want to puruse additional information on FAT 16 "table
contents" and clusters of sectors, please make another clarification
request. I can do research on that data if needed.
  --Maniac
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy