Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Would Atapi Execute Ata Commands?

ATAPIATA commands execute would compatible support read write sector size

  • Please log in to reply
2 replies to this topic

#1 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 15 June 2012 - 05:06 PM

Hello.

I am trying to write ATA drivers and I am not sure whether I can just use ATA drivers to access CD drives or if I have to use ATAPI drivers for that purpose.

Do ATAPI devices support ATA commands?

Also, if they do, then how do I handle the sector size? I mean, the sector size for ATA devices is 512 but for ATAPI it's 2048. And when writing or reading data with ATA (PIO mode), the driver needs to send or receive 256 words of data to/from the device controller, and this wouldn't make sense with 2048-byte sector size.


Thanks in advance.
  • 0
Regards,
RR

#2 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 17 June 2012 - 02:22 PM

What operating system would this be running on? Are you writing your own?
  • 0

sudo rm -rf / && echo $'Sanitize your inputs!'


#3 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 17 June 2012 - 07:09 PM

I wonder what happened to this thread's title; I thought I named it "... ATAPI ... ATA ..." , not "... Atapi ... Ata ..." . Also the tags got a little bit messed up with the "ATAPIATA" insead of "ATAPI" and "ATA" . Anyway, hopefully people searching for related information would be able to find this page.


* * *


As for what operating system this is for, I don't see how that would make a difference but yes, I want to eventually have a new operating system that is not dependent on Linux or anything like that, so I am writing my own.

In ATA, the code needs to send the 0x20 or 0x24 command to read from the disk, while in ATAPI I don't know if those numbers mean the same thing. SCSI devices do use somewhat different commands, but I'm just not sure whether an ATAPI device will properly execute the ATA 0x20 (READ SECTORS), 0x24 (READ SECTORS EXT), 0x30 (WRITE SECTORS), and 0x34 (WRITE SECTORS EXT) commands.
  • 0
Regards,
RR





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download