Recently I was curious about the data transfer procedure between the hard drive and os(just take windows xp as an instance). And the following is my understanding of this so far and there may be a lot of misunderstanding. Please point them out and thanks. The data was transferred between windows xp and hard drive through the SATA interface. The SATA interface was made up of the SATA controller on the motherboard of PC, the 40-pin SATA cable, and the hard drive. There are many registers related to the SATA interface, such as Command Register, Data Port/Data Register, Device Register, Features Register, Device Control Register, Sector Count Register, Status Register which Contains the hard drives current status which includes the Busy bit(BSY), Device Ready bit (DRDY), and Error bit (ERR). Here I am not sure about this. Does both the hard drive inside and the SATA controller have these registers? Just like two computers which communicate through a network cable, the TCP/IP protocol is as the SATA protocol, the SATA controller and the hard drive is responsible for decomposing, packaging the SATA protocol like network cards. The SATA controller receives a Device Identify command EC from the windows xp, then it selects the target hard drive, sends EC command to the hard drive's Command Register. The hard drive recognizes this request by some interrupt notification and then it finds out the request is to gather parameters about this drive itself. So it collects the requested info from the cache buffer or from the SA on the platters by reading and transfers it back to the SATA controller. Here is the question, the 512 bytes parameter is transferred directly from the memory in the hard drive to the SATA controller DATA Register, or the 512 bytes parameter is first transferred from the memory in the hard drive to the Data Register in hard drive, and then to the Data Register in the SATA controller on the motherboard?
|