Device enumeration
Ruslan Ermilov
ru at freebsd.org
Thu Sep 28 03:54:11 PDT 2006
On Thu, Sep 28, 2006 at 03:24:37AM -0700, Alok Barsode wrote:
> Hi,
> I am a newbie working on FreeBSD 4.10.
>
> I am a bit confused between i386/conf/GENERIC and
> i386/conf/GENERIC.hints.
>
> Does a device driver's probe/attach routine is invoked
> when a enty is made for it in the GENERIC file?
> for example an enty in the GENERIC file will be :
> device nge # NatSemi DP83820 gigabit Ethernet
> Does the probe routine in if_nge.c invoked when the
> kernel encounters the above entry?
>
No. The magic is in the following line in if_nge.c:
DRIVER_MODULE(if_nge, pci, nge_driver, nge_devclass, 0, 0);
It attaches the nge_driver to the pci bus.
> How can I probe/attach a device which is not
> self-identifying? Like a memory mapped device? Does an
> entry in the GENERIC file make sure the probe/attach
> function will be called for it?
>
Like ISA non-PnP devices?
> How can I identify where in the device hierarchy is it
> located?
>
On modern FreeBSD versions, 5,x and 6.x, there's a devinfo(8)
utility that allows to retrieve this kind of information.
> The device is not connected to any BUS. so
> will it be a independent device?
>
I think you'll have to use some kind of a bus. When I
worked on a port of adm5120 for NetBSD, we used the obio
bus which stands for the "onboard I/O" and is not a real
bus. The configuration on that bus was static.
> In GENERIC.hints a device's bus, port,irq are
> mentioned. What is the actual purpose of doing so?
>
This is for legacy non-PnP ISA devices mostly, and
for some slave devices, like floppy drivers attached
to a floppy controller, and PS/2 mouse and AT keyboard
to the AT keyboard controller:
$ grep -w at GENERIC.hints | grep -vw "isa"
hint.fd.0.at="fdc0"
hint.fd.1.at="fdc0"
hint.atkbd.0.at="atkbdc"
hint.psm.0.at="atkbdc"
GENERIC.hints doesn't exist in 4.10, by the way.
Cheers,
--
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-new-bus/attachments/20060928/8da2082e/attachment.pgp
More information about the freebsd-new-bus
mailing list