Date: Mon, 09 Mar 2015 12:01:43 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-drivers@freebsd.org Cc: =?ISO-8859-1?Q?Mat=EDas?= Perret Cantoni <perretcantonim@gmail.com> Subject: Re: load a driver during autoconfiguration Message-ID: <5070289.9Ox4kP5ZdP@ralph.baldwin.cx> In-Reply-To: <CADLKG03WSkbPPWwDkxd3NPa1q0cVP8C0JvA0T=Jwy2=wGv_tiA@mail.gmail.com> References: <CADLKG03WSkbPPWwDkxd3NPa1q0cVP8C0JvA0T=Jwy2=wGv_tiA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, March 06, 2015 04:15:22 PM Mat=EDas Perret Cantoni wrote: > Hello! >=20 > I just wrote a simple newbus driver that works just fine when I load = it > manually with kldload(8). >=20 > Now I'd like the system to load it automatically at boot time. I've a= lready > added the corresponding node on the dts file. >=20 > So my questions are: >=20 > Can I just place the driver under some directory so that the system c= an > probe it during auto-configuration? >=20 > Or do I need to re-compile the whole kernel for this? In that case wh= ere > should I place my sources before compiling? One option is to always load the driver using an entry in loader.conf o= r in=20 the kld_list variable in /etc/rc.conf. Another option to do on-demand = loading=20 is to write a custom devd handler. You can find some examples in=20 /etc/devd/usb.conf (note that that file is auto-generated). I'm not su= re what=20 is output for a nomatch entry for an fdt bus. For devices that appear = at=20 runtime you can run 'cat /var/run/devd.pipe' in a window to see event d= etails=20 to use to write your match rule. However, for boot time events I think= you=20 will need to resort to looking at the code to decipher what variables a= re=20 passed that you want to match on. --=20 John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5070289.9Ox4kP5ZdP>