Re: block "ide" device drivers

Theodore Y. Ts'o (tytso@MIT.EDU)
Tue, 7 Oct 1997 17:57:03 -0400


Date: Thu, 02 Oct 1997 19:14:36 -0400
From: Richard Gray <sgray@preferred.com>

I'm sorry if this message is out of place but at this point my brain is
about to exploid.
I'm trying to understand how the ide device driver works. What kernel
source code files should I look at and almost as importantly in which
order. I've started to look over ide.c but it contains functions which
are called from somewhere within the kernel. I"m interested in
understanding when, why and how these functions are called. I going
through the code is the only way I'm ever going to truely understand
what is going on. I would to construct a flowchart with decribes how
the ide driver work. I think this will help me to understand the code
and how the different parts of it tie together.

Hi Richard,

I don't know if anyone has responded to you yet. Unfortunately,
the block device drivers (which includes the ide device driver), uses a
flow of control that can only be charitably called "obtuse". It's
actually fairly efficient, but it's way too complex, and that whole
interface probably needs to be rewritten from scratch. There have been
a number of efforts to design such a new interface, but it's complex
enough that we've never quite finished the redesign, never mind the
implementation.

(The problem is that in order to be efficient and fast in the
face of multiple block requests, and re-ordering requests, and
issueing multiple SCSI commands, etc., the block device queueing
interface gets really complex!)

The files where you will want to look include:

include/linux/blk.h
drivers/block/ll_rw_blk.c

This is where most of the block device driver interface is
located, and that should help you understand the ide device driver.
Good luck!!

- Ted