Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Hard Disk Sizing

Hard Disk Sizing

Hard Disk Sizing

Hai All ,
     I am having a basic doubt in Harddisk Sizing. When a new Harddisk is connected to the computer, How  the size of the Harddisk is calculated?  Or the size of the Harddisk is stored anywhere in the Harddisk itself..

 With regards

RE: Hard Disk Sizing

For unformatted hard drives you can retrieve some of the information directly from the drive controller. Interrupt 41h comes to mind but I'm probably wrong and can't verify that without my books on hand. Some of the calls to the controller are very much hardware dependant so make sure you research them very carefully before you lay down any code.

Practically any information you would ever need about a formatted disk can be found in the boot record. It can be accessed with a simple call to Interrupt 13h, function 2h.

Do your research at http://www.ctyme.com/rbrown.htm (Ralf Brown's Interrupt List). You'll find many pages of tables, etc. relating to data stored in the boot record.

Take the usual precautions: always experiment on a drive that you won't mind reformatting.

A plain black box
Don't sit down. It's time to dig another one.

RE: Hard Disk Sizing

  I have got the Ralf Browns Interrupt list. And I saw the Int 41h. The vector does not point a routine. It points a table. The table has info about the number of cylynders, number of heads etc. It does not have info related to the size.
 And one more thing. The BIOS only has to the fill the table info . How the  BIOS get the info?

 with regards

RE: Hard Disk Sizing

Sorry about that, Sivasakthi. Even now that I have my books I can't remember how to retrieve the information directly from a hard disk controller. Actually Int41 and a few others will give you the data you require. Hard disk size is directly related to the number of heads and cylinders. You just have to do a little math.

Does anybody know a more direct way to do this?

A plain black box
Don't sit down. It's time to dig another one.

RE: Hard Disk Sizing

The BIOS will probably get the harddisk related info from the CMOS. This is the piece of RAM that needs that little battery inside your computer, without it your computer won't know if it has a harddisk, a CD-ROM drive, a diskette station, it will even forget how much memory you've got, etc. (and it will therefore not even be able to print some confusing message on the screen).
To change the values in the CMOS you have to press <DEL> at startup (or <F1> or <ESC> or you have to restart the machine with <Ctrl-Alt-ESC> or <Ctrl-Alt-Enter>).
The harddidsk specific information you will find in its documentations (sometimes it is written somewhere on the disk itself, but then you'll need to open your computer).


Bert Vingerhoets
Don't worry what people think about you. They're too busy wondering what you think about them.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close