Re: Device enumeration
Ruslan Ermilov <[email protected]> Thu, 28 Sep 2006 14:54:01 +0400
| Newsgroups | gmane.os.freebsd.devel.new-bus |
|---|---|
| Message-ID | <[email protected]> |
--+B+y8wtTXqdUj1xM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 28, 2006 at 03:24:37AM -0700, Alok Barsode wrote: > Hi, > I am a newbie working on FreeBSD 4.10. >=20 > I am a bit confused between i386/conf/GENERIC and > i386/conf/GENERIC.hints.=20 >=20 > Does a device driver's probe/attach routine is invoked > when a enty is made for it in the GENERIC file?=20 > for example an enty in the GENERIC file will be :=20 > device nge # NatSemi DP83820 gigabit Ethernet =20 > Does the probe routine in if_nge.c invoked when the > kernel encounters the above entry?=20 >=20 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?=20 >=20 Like ISA non-PnP devices? > How can I identify where in the device hierarchy is it > located? >=20 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?=20 >=20 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? >=20 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=3D"fdc0" hint.fd.1.at=3D"fdc0" hint.atkbd.0.at=3D"atkbdc" hint.psm.0.at=3D"atkbdc" GENERIC.hints doesn't exist in 4.10, by the way. Cheers, --=20 Ruslan Ermilov [email protected] FreeBSD committer --+B+y8wtTXqdUj1xM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFG6nJqRfpzJluFF4RAsrMAJ9bGBrEYlClPclCTLqN2f8XWMniFQCfQh5e NKaOu/prfcATBa9RiZiCVuM= =ltgk -----END PGP SIGNATURE----- --+B+y8wtTXqdUj1xM--