Page 1 of 1

ATA PIO Mode: DRQ Block Size

Posted: Wed Feb 02, 2011 1:49 pm
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...

Re: ATA PIO Mode: DRQ Block Size

Posted: Wed Feb 02, 2011 6:33 pm
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.