Subject: Re: Device Driver debug HOWTO?
To: Michael Thompson <m_thompson@ids.net>
From: Jeremy Cooper <jeremy@simon.sfsu.edu>
List: netbsd-help
Date: 11/02/1999 14:45:44
On Tue, 2 Nov 1999, Michael Thompson wrote:

> [...]
> Where can I find documentation on the autoconfig process?
> 
> How does the board's address get to the driver during
> the autoconfig?
> [...]

It's been plugged before, but the book "The Design and Implementation of
the 4.4 BSD Operating System" (aka. the Red Book) describes the basics of
the autoconfiguration system quite well.  In a nutshell, the
autoconfiuration system views the hardware as a tree of busses, much as
you can view the Internet as a tree of local networks.

As to your second question, the autoconfig process first politely asks the
driver if it can find a device by calling the driver's probe() routine.
This routine is given a structure which contains the suggested address and
other resource information as given from the kernel configuration file.
The device driver may modify this structure if it so chooses.  (For
example, it may find during the probing process that a device has been
hardwired to request service through a different IRQ than that which was
compiled in the kernel configuration file.)

Next, if the driver signifies that it has indeed found a device to
control, the configuration process will call the driver's attach() routine
and hand it the same structure that it gave to the probe() routine.  It is
at this time that the driver truly receives its address.

-J