ATA PIO Mode: DRQ Block Size

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
iocoder
Member
Member
Posts: 208
Joined: Sun Oct 18, 2009 5:47 pm
Libera.chat IRC: iocoder
Location: Alexandria, Egypt | Ottawa, Canada
Contact:

ATA PIO Mode: DRQ Block Size

Post by iocoder »

Hi all!
While writing a function to process "PIO IN" Protocols for ATA Devices, I found that i should "insw" 256 words each time, as DRQ Block Size is 256 words. so is this number (256 words) constant?? or it is the common for ATA??
why we always do 16-bit PIO transfers? how could i know in which PIO mode the device works?
thanks and regards...
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: ATA PIO Mode: DRQ Block Size

Post by bewing »

so is this number (256 words) constant?
When doing actual data transfers, ATA PIO mode is only used for accessing PATA hard disks. Up until very recently, all PATA hard disks were standardized as having a sector size of 512 bytes. So the answer to your question has always been "yes". But that may have changed. There may be a chance, now, that some drive manufacturer may create a PATA drive with a 4K sector size. We will have to see. It is also possible to change the DRQ Block Size with an ATA command on some drives. If you do, then you need to read a different number of words. But I don't recommend resetting the block size.
why we always do 16-bit PIO transfers?
The ATA standard and the hardware requires it. If you do not do 16-bit transfers, the transfer will fail invisibly, and you will get bad data.
how could i know in which PIO mode the device works?
I don't understand the question. Each type of device has only one PIO mode.
Post Reply