PDA

View Full Version : How can I figure out the size of a hard disk in .ASM Language?


simdolha
May 14, 2006, 01:53 PM
I have a problem in trying to determine the size of a hard disk > 8Gb, in assembly language, because int13 extensions are not supported. If someone could suggest how to do this, I would grately appreciate it. I would also want to know if I could determine the model, name and vendor of the hard disk. Thank you very much.

cajalat
May 16, 2006, 06:37 PM
At the risk of carbon dating myself I'll try to offer some suggestions but I'm really rusty in assembly.

So you want to read drive geometry beyond the 8.4GB limit imposed by CHS... I do recall there were newer (really old by now) extensions to int13 called extended int13 extensions which allowed you to do drive translations from physical (CHS) to Logical (LBA). I don't think CHS was actual physical but it doesn't matter. Most BIOSes now-a-days support extended int13 (i.e. they can allow you to do LBA in the BIOS). (ok... here's where you'll have to take what I say with a grain of salt because I'm really rusty... ) So you need to pass a value to the AH register of what you want to test for. I don't remember what that is but it basically tests for enhanced int13 support. Then if you can support extended int13 there are additional calls that you can make by populating? I think? AH with another value which after the int13 call would dump the data in another memory location that you set with?? another pointer?. Now my brain hurts. At least I hope it gives you some clue.

Sorry I couldn't be more help.

Casey