Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2006, 20:45
new_profile new_profile is offline
VIP
 
Join Date: Aug 2002
Posts: 148
Rept. Given: 27
Rept. Rcvd 7 Times in 7 Posts
Thanks Given: 43
Thanks Rcvd at 42 Times in 19 Posts
new_profile Reputation: 7
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.
Reply With Quote
  #2  
Old 08-07-2006, 22:32
pnemeth
 
Posts: n/a
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
Reply With Quote
  #3  
Old 08-08-2006, 01:20
MarkusO
 
Posts: n/a
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.
Reply With Quote
  #4  
Old 08-08-2006, 14:47
new_profile new_profile is offline
VIP
 
Join Date: Aug 2002
Posts: 148
Rept. Given: 27
Rept. Rcvd 7 Times in 7 Posts
Thanks Given: 43
Thanks Rcvd at 42 Times in 19 Posts
new_profile Reputation: 7
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.
Reply With Quote
  #5  
Old 08-08-2006, 15:34
pnemeth
 
Posts: n/a
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
Reply With Quote
  #6  
Old 08-08-2006, 18:14
new_profile new_profile is offline
VIP
 
Join Date: Aug 2002
Posts: 148
Rept. Given: 27
Rept. Rcvd 7 Times in 7 Posts
Thanks Given: 43
Thanks Rcvd at 42 Times in 19 Posts
new_profile Reputation: 7
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.
Reply With Quote
  #7  
Old 08-08-2006, 19:27
new_profile new_profile is offline
VIP
 
Join Date: Aug 2002
Posts: 148
Rept. Given: 27
Rept. Rcvd 7 Times in 7 Posts
Thanks Given: 43
Thanks Rcvd at 42 Times in 19 Posts
new_profile Reputation: 7
pnemeth,
Again thank you very much for the link. What I need is the command IDENTIFY DEVICE (CEh).

Cheers.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


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


All times are GMT +8. The time now is 07:58.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )