MultiDrive – free backup, clone & wipe disk utility from Atola Technology

All times are UTC - 5 hours [ DST ]


Switch to mobile style


Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Why SET MAX ADDRESS(0xF9) of ATA cmd of IDE hard disk Aborts
PostPosted: October 24th, 2005, 8:31 
Offline

Joined: October 24th, 2005, 8:05
Posts: 6
when I am executing SET MAX ADDRESS(0xF9) of ATA command, it is Aborting...For Aborting there are 2 reasons specified in "IBM HD Spec.pdf"
> when Volatility bit -1 for permanent removing of HPA is specified and in Address offset mode, command is aborted...
> READ_NATIVE_MAX_ADDRESS should be immediately called before SET MAX ADDRESS, otherwise command is aborted...

I wish to remove HPA temperorily and take care of the above 2 precautions, still SET_MAX command is aborting... IDENTIFY_DEVICE, READ_NATIVE_MAX_ADDRESS cmds are executing perfectly...

Before executing READ_NATIVE_MAX_ADDRESS, IDENTIFY_DEVICE cmd is executed...When IDENTIFY DEVICE cmd is issued 10th bit of word 82 is 0 returned by device i.e, HPA feature set is not supported...If that is the case, I'm able to execute READ_NATIVE_MAX_ADDRESS CMD and with one tool I'm able to create & remove HPA...All the SET MAX cmds are aborted....

Please send me suggestions or solution if possible for not aborting SET MAX ADDRESS cmd....

Regards,
mohan.


Top
 Profile  
 
 Post subject:
PostPosted: October 25th, 2005, 2:26 
Offline

Joined: September 27th, 2005, 5:04
Posts: 37
Please let me know that under which platform you are working ?


regards

PS : Where to find "IBM HD Spec.pdf" .


Top
 Profile  
 
 Post subject: Why SET MAX ADDRESS(0xF9) of ATA cmd of IDE hard disk Aborts
PostPosted: October 25th, 2005, 3:21 
Offline

Joined: October 24th, 2005, 8:05
Posts: 6
I'm thankful to u for ur prompt response...I'm working under Windows....

Please refer " hitachigst.com/tech/techlib.nsf/techdocs/85256AB80..." and " Protected Area –Locking Proposal 1 Background 2 Principles of .." in Google, so that u can get more info regarding SET MAX cmds...

I'm eagerly waiting for ur precious suggestions....

Best Regards,
Mohan.


Top
 Profile  
 
 Post subject:
PostPosted: October 25th, 2005, 5:46 
Offline

Joined: October 19th, 2005, 5:52
Posts: 167
http://www.chmtools.com/forum/techwr-wh ... -3634.html


Top
 Profile  
 
 Post subject:
PostPosted: October 25th, 2005, 6:01 
Offline

Joined: October 19th, 2005, 5:52
Posts: 167
Hehehe, so I will go to google to look docs about ATA commands ?
Ok, and in return I will give you this:
just go to T13 org and you will find some answers for your question.
If you was there in first moment you did not had to waste your time writting post in places whre noone possible have answer to your question.
Bah


Top
 Profile  
 
 Post subject:
PostPosted: October 25th, 2005, 7:23 
Offline

Joined: October 24th, 2005, 8:05
Posts: 6
Already I have read t13.org...Based on this and other docs, I observed the following are the causes for aborting...

1.) READ_NATIVE_MAX_ADDRESS should be immediately called before SET MAX ADDRESS, otherwise command is aborted...
2.) DRDY set equal to one before executing cmd otherwise cmd is aborted
3.) if the cmd is not supported or maximum value requested exceeds the device capacity, cmd is aborted.
4.)If device is in Set Max Locked mode, cmd is aborted

Everything I checked, but I'm unable to check 2nd cond...It can be checked if it is written in device driver by getting status from port but it is not supposed... It should be written through windows API calls...


Top
 Profile  
 
 Post subject:
PostPosted: October 25th, 2005, 7:51 
Offline

Joined: October 11th, 2005, 6:04
Posts: 34
Location: St.Petersburg, Russia
nagamohan_p wrote:

Everything I checked, but I'm unable to check 2nd cond...It can be checked if it is written in device driver by getting status from port but it is not supposed... It should be written through windows API calls...


Hm, take DOS and write simple programm sending ATA commands, after you having working source for DOS you will be know what you send commands correctly, and can port it to the Windows...

_________________
best regards, vi http://www.scspb.ru/pchdd/ http://pchdd.narod.ru


Top
 Profile  
 
 Post subject:
PostPosted: October 25th, 2005, 8:03 
Offline

Joined: October 24th, 2005, 8:05
Posts: 6
Already we have written in dos ( directly accessing the ports) ie, but the calls are different from window API calls...In windows, I should test status of Devce controller whether it is ready i.e, DRDY...Is there any Ioctl for knowing the status...

Any suggestions will be appreciated and thanks in advance...


Top
 Profile  
 
 Post subject:
PostPosted: October 25th, 2005, 9:13 
Offline

Joined: October 11th, 2005, 6:04
Posts: 34
Location: St.Petersburg, Russia
nagamohan_p wrote:
Already we have written in dos ( directly accessing the ports) ie, but the calls are different from window API calls...In windows, I should test status of Devce controller whether it is ready i.e, DRDY...Is there any Ioctl for knowing the status...

Any suggestions will be appreciated and thanks in advance...


Windows version? What API you use? etc.

May be this API don't provide such low level stuf as DRDY etc?

_________________
best regards, vi http://www.scspb.ru/pchdd/ http://pchdd.narod.ru


Top
 Profile  
 
 Post subject:
PostPosted: October 25th, 2005, 9:40 
Offline

Joined: October 24th, 2005, 8:05
Posts: 6
DeviceIoControl(hDevice, IOCTL_IDE_PASS_THROUGH, pAPT, Size, pAPT, Size, &BytesReturned, (LPOVERLAPPED)NULL);

pAPT is structure obj filled with
/* IDE/ATA command request structure in windows*/
//0 - IDE_FEATURE_OFFSET
//1 - IDE_NSECTOR_OFFSET
//2 - IDE_SECTOR_OFFSET
//3 - IDE_LCYL_OFFSET
//4 - IDE_HCYL_OFFSET
//5 - IDE_SELECT_OFFSET
//6 - Command

Any suggestions will be appreciated and thanks in advance...


Top
 Profile  
 
 Post subject:
PostPosted: October 25th, 2005, 11:22 
Offline

Joined: October 3rd, 2005, 0:40
Posts: 4755
Location: Hungary
Hi,

In the windows environment it is not so easy tracking the drive's behaviour than in DOS. So I would suggest writing a working code in DOS as U've already tried.
I would try a known good drive that supports HPA (test it with MHDD), then write code in DOS to work with that.
If it works, I would try the drive in the subject.

regards,
pepe


Top
 Profile  
 
 Post subject:
PostPosted: October 26th, 2005, 2:30 
Offline

Joined: October 24th, 2005, 8:05
Posts: 6
Hi,
Writing in Dos and Windows is entirely different...In Dos, we directly interact with ports through inp & outp calls...In Windows we interact with Device Controller that's what we use DeviceIoControl API call for sending ATA cmds...So we don't think writing in DOS...It should not be written through Device Driver...

Ofcourse, I use Maxtor 6L020L1 hard disk...It supports HPA...READ_NATIVE_MAX_ADDRESS & IDENTIFY_DEVICE are successfully executed

In os_win32.c file, I observed "ATA data-out cmd are unable to execute if smart ioctl doesn't support" but SET_MAX is not data-out cmd, still it is aborting...

Any suggestions will be appreciated and thanks in advance...

Regards,
mohan.


Top
 Profile  
 
 Post subject: Re:
PostPosted: August 12th, 2007, 19:50 
Offline

Joined: August 12th, 2007, 11:03
Posts: 1
nagamohan_p wrote:
Hi,
Writing in Dos and Windows is entirely different...In Dos, we directly interact with ports through inp & outp calls...In Windows we interact with Device Controller that's what we use DeviceIoControl API call for sending ATA cmds...So we don't think writing in DOS...It should not be written through Device Driver...

Ofcourse, I use Maxtor 6L020L1 hard disk...It supports HPA...READ_NATIVE_MAX_ADDRESS & IDENTIFY_DEVICE are successfully executed

In os_win32.c file, I observed "ATA data-out cmd are unable to execute if smart ioctl doesn't support" but SET_MAX is not data-out cmd, still it is aborting...

Any suggestions will be appreciated and thanks in advance...

Regards,
mohan.

I encounterd the same problem when I use DeviceIoControl to send ATA command SET MAX ADDRESS. The status of DeviceIoControl is success, but the status register of IDE controller is 0x51 which means an error occured. After check the error register, I found the error bit 3 is set to one (ABORT).
Any suggestions will be appreciated.


Top
 Profile  
 
 Post subject: Re: Why SET MAX ADDRESS(0xF9) of ATA cmd of IDE hard disk Aborts
PostPosted: August 14th, 2007, 12:24 
Offline

Joined: January 29th, 2005, 22:58
Posts: 637
Location: Canada
DeviceIoControl is not good, even with PASS_THROUGH. The fact is that you are still working with Windows, not with the drive directly and Windows decides what commands to let through and what not.
In fact, it lets through only non-destructive commands like SMART, IDENTIFY_DEVICE, SLEEP, STANDBY, READ_SECTOR etc.
SET_MAX_ADDRESS works, but still there are problems with it. For example, I have 200GB drive with HPA set to 100GB. Windows sees that it's under 128GB and thinks that drive works only with 28bit commands and when I send a valid 48bit command to reset HPA it just aborts it.
So, ABORT error that you see was sent to you not by the drive, but by the Windows. For some reason, Windows didn't like your command (try to play with Device register - most likely because of it).

To sum up, DeviceIoControl sucks :)
The best way to work directly with the drive on the register level is to use GiveIO. You will have to disable Secondary port and work with the registers as in DOS, without any interference from Windows drivers. ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group