Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hard Disk Sizing

Status
Not open for further replies.

sivasakthi

Programmer
Sep 11, 2000
6
0
0
US
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
Sivasakthivel [sig][/sig]
 
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 (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.
[sig]<p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>Don't sit down. It's time to dig another one.[/sig]
 
Hai
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
Siva
[sig][/sig]
 
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?
[sig]<p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>Don't sit down. It's time to dig another one.[/sig]
 
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).

Regards, [sig]<p>Bert Vingerhoets<br><a href=mailto:vingerhoetsbert@hotmail.com>vingerhoetsbert@hotmail.com</a><br><a href= worry what people think about you. They're too busy wondering what you think about them.[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top