misc questions about the device&driver arch

Warner Losh imp at bsdimp.com
Fri May 19 22:22:26 PDT 2006

> about  devclass_find_internal
> devclass_find_internal will  be called to create a new devclass in
> such 2 conditions :
> one is creating a new device , as : if (name) {  dc =
> devclass_find_internal(name, 0, TRUE);
> another is  in the function:devclass_add_driver. but ,if a driver 's
> name is different from the name of any deviceclass  in the system ,it
> just create a new devclass ,and link it self into the parent
> busdevice's driver link  and do nothing .what is the use of the driver
> at this situation?

Busses create devices to represent hardware in the system.  The bus
then causes these devices to be probed and attached.  This latter
usage is for those cases.  As drivers are loaded these devices are
offered to the new (and old) drivers in the system.

FreeBSD inherently dynamic in its device system.  The hardest part of
adding hotplug support is programming the bridge.  Adding new devices
to the tree is easy, but knowing when to add them is hard since you
have to write a bridge driver...


More information about the freebsd-hackers mailing list