We help IT Professionals succeed at work.

Write data to HDD sectors using write DMA command (0xCA)

nedfine
nedfine asked
on
719 Views
Last Modified: 2009-11-05
I am trying to write data to hdd sectors usig write DMA command. (0xCA)
The command gets executed successfully without any error, but the data is not getting written to the sectors. I am using DJGPP compiler and I am executing the code in dos mode only.
After executing the program, sectors are filled with some garbage values.  How do i pass the data buffer to this method?
Comment
Watch Question

CERTIFIED EXPERT
Author of the Year 2009

Commented:
Please tell me more about the "DMA command" that you are using,
CERTIFIED EXPERT

Author

Commented:
Thanks for the response.

I am using the ATA Command to write data to sectors using DMA access. Write DMA (0xCA).
For this we have to pass some parameters to the Base port address of IDE controller.like 0xIF0 and 0x170.. This parameter inputs contains sector address where we need to write the data. and command (0xCA) sector count etc.
I am able to execute the command successfully. But I dont know where and how I need to keep the data buffer so that while executing the ATA command it will take the data from that memory location.
Now what has  happened is that after executing the command (0xCA), it is writing some other data  to the hard disk sectors.
So I want to know where and how I can keep my buffer so that the command can refer that buffer to fill the sectors.
 
You can see more details about this ATA command in ATA/ATAPI standard 6.0 .
 
Thanks,
Ned
CERTIFIED EXPERT
Author of the Year 2009
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.