Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   Hard drive parameters (https://forum.exetools.com/showthread.php?t=10006)

new_profile 08-07-2006 20:45

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.

pnemeth 08-07-2006 22:32

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

MarkusO 08-08-2006 01:20

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.

new_profile 08-08-2006 14:47

Quote:

Originally Posted by MarkusO
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.

I'm actually porting the ext2 filesystem on my platform which is an STB (Set Top Box). The platform I'm using is based on a 5100 processor from ST (OS20). Unfortunately, the API (STATAPI) does not provide such information so I'm trying to add such functionnality.

Thank you for your help.

pnemeth 08-08-2006 15:34

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

new_profile 08-08-2006 18:14

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.

new_profile 08-08-2006 19:27

pnemeth,
Again thank you very much for the link. What I need is the command IDENTIFY DEVICE (CEh).

Cheers.


All times are GMT +8. The time now is 09:57.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX