ATA master and slave

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
natp
Posts: 6
Joined: Tue Apr 07, 2009 9:08 pm

ATA master and slave

Post by natp »

If there are two drives on one ATA interface (master and slave),must I issue a command to one drive and wait until it's finished before I can do the same with the other drive?

I know about overlapped commands but do many drives support it? Do Linux and Windows support this feature?

Also, are ATA (not ATAPI) drives with removable media as rare as they seem to be? Is it worth supporting removable media in the ATA code?
CrypticalCode0
Member
Member
Posts: 81
Joined: Wed Nov 09, 2011 2:21 am
Location: Behind a keyboard located in The Netherlands

Re: ATA master and slave

Post by CrypticalCode0 »

The initial ATA standard didn't support hot swapping that is one of the reasons the ATAPI protocol was made.
And thus as a whole doesn't allow removable media this doesn't mean it hasn't been done in the past, it's one of the common tricks for reading a Xbox classic HDD.
MihailB
Posts: 17
Joined: Thu Sep 08, 2011 7:32 am
Location: Romania
Contact:

Re: ATA master and slave

Post by MihailB »

natp wrote:If there are two drives on one ATA interface (master and slave),must I issue a command to one drive and wait until it's finished before I can do the same with the other drive?

I know about overlapped commands but do many drives support it? Do Linux and Windows support this feature?

Also, are ATA (not ATAPI) drives with removable media as rare as they seem to be? Is it worth supporting removable media in the ATA code?
so lets say we access 0x1f0 ports to for master driver and issue a
read sector command
and then suddenly the timer issues a timer interrupt and then
schedules another thread
which want to read from slave drive on 0x1f0
[the other thread was left at lest say: rep insw]
the new thread will reconfigure 0x1f0 and start to read from slave drive
but when timer scheduels back the older thread
it will continue from rep insw [but what rep insw since 0x1f0 is one port !!!]
so it will get stucked !!!

you can not issue parallel things like that {unless they are atomic operations};
if the drives uses differrent slots (aka one is 0x1f0 and the other one is 0x170) then it's ok you can read from both of them at the same time (can use PIO/DMA/UDMA whatever)

thats why Serial ATA is better [but unfurtunatly harder to implement]

ps:sorry for any grammar mistakes
Post Reply