good sharing.   following up on your comments:<div><br></div><div>in the kernel source:</div><div><br></div><div>block/*.c are the files for block I/O related stuff - the layer just before ATA, implementing stuff like elevator I/O etc.</div>
<div>drivers/block/*.c:  hardware-specific files that understand how to talk to each type of harddisk.</div><div>drivers/scsi/*.c:   generally SCSI protocol related stuff (lib*.c), but may contain device specific stuff. </div>
<div>drivers/ide/*.c: </div><div>drivers/ata/*.c:   among the lowest level just before sending out port I/O operation.</div><div><br><div class="gmail_quote">On Fri, Feb 8, 2013 at 8:26 AM,  <span dir="ltr">&lt;<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, 08 Feb 2013 07:48:39 +0800, Peter Teoh said:<br>
<br>
&gt; So the drivers just literally concatenate these command into a string and<br>
&gt; send it over to the device.<br>
<br>
</div>The reason that good disk drivers are hard to write is because it isn&#39;t<br>
*just* literally concatenating the commands - it also has to do memory<br>
management (make sure that everybody&#39;s data ends up in the right buffers),<br>
command queue management, elevator management (if there&#39;s multiple I/O<br>
requests pending from userspace, what order do we issue them in?), error<br>
recovery, power management, and a ton of other stuff...<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh
</div>