#1
|
|||
|
|||
Hard drive parameters
Hi all,
Having a hard disk, how it is possible to know its paramaters : number of heads, cylinders, total number of sectors, serial number, ... ? I'm not interested in Windows API as I'm actually working on an embedded system where all I've got is some API to read and write blocks from IDE Bus. I've tryed reading the hdparms linux command but all what it does is using the IOCTL API. Is there any special sector to read from or a special command to the controller to access these parameters ? Thank you. |
#2
|
|||
|
|||
Hi new_profile,
Do you have are hardware or a software IDE implementaion? Most hardware IDE controllers will automatically report this information to you (read the datasheet?). In a software implementation, it's your own software that defines how many cylinders/head there are, right? A non-elegant method would be to make requests from every cylinder/head sequentially and wait for an error... Hope that helped, somewhat -pnemeth |
#3
|
|||
|
|||
Has your "embedded system" x86 architecture and is using a "normal" BIOS? If yes, you could use INT 13 calls (namely 08 and 48) to get the hard disc parameters.
|
#4
|
|||
|
|||
Quote:
Thank you for your help. |
#5
|
|||
|
|||
For IDE interfaces accessed with CHS translations (i.e. ones over 8 gigabytes), it will be the software IDE implemtation that determines the number of logical heads and cylinders.
Unfortunately, we really don't know very much about your setup (I've never head of the ST 5100 nor was i able to find any information on ST's website (must be before my time?)) so we can only provide a limited amount of support. Here is an interesting document: hxxp://www.seagate.com/support/disc/manuals/ata/d1153r17.pdf That READ NATIVE MAX ADDRESS command on page 151 (pdf page 165) looks interersting, but it also looks like it doesn't necessarily work on all drives. If your API has a funtion to write a command to the ATA controller (or if you can directly control io), then that may well be what you need. There seem to be quite a few documents on the internet that show examples of how to interface 8-bit microcontrollers with IDE drives, but most of them are not running on a RTOS and using an API... I would imagine some specifics on which API functions are available to you could be helpful to anyone else trying to help, as well. Good luck! -pnemeth |
#6
|
|||
|
|||
pnemeth, thank you for the document. I will try with some hard disks and see if it work.
The processor I'm using is the ST5100 from ST microelectronics that is the successor of the 5518 (low cost STB processors) and it runs with OS20 as RTOS. Thank you. |
#7
|
|||
|
|||
pnemeth,
Again thank you very much for the link. What I need is the command IDENTIFY DEVICE (CEh). Cheers. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to determine the parameters of a function in OllyDbg | congviet | General Discussion | 2 | 06-15-2011 16:06 |