Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Apr 2015 16:18:58 -0300
From:      =?UTF-8?Q?Mat=C3=ADas_Perret_Cantoni?= <perretcantonim@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        freebsd-drivers@freebsd.org
Subject:   Re: load a driver during autoconfiguration
Message-ID:  <CADLKG00AuNk5ky35j7Z%2BUxk%2BGyrRPsxRSf850QPH6tU68-U0Zw@mail.gmail.com>
In-Reply-To: <21B44158-07C3-47AE-8132-BE5F2B408697@bsdimp.com>
References:  <CADLKG03WSkbPPWwDkxd3NPa1q0cVP8C0JvA0T=Jwy2=wGv_tiA@mail.gmail.com> <5070289.9Ox4kP5ZdP@ralph.baldwin.cx> <21B44158-07C3-47AE-8132-BE5F2B408697@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2015-03-09 15:03 GMT-03:00 Warner Losh <imp@bsdimp.com>:

>
> > On Mar 9, 2015, at 10:01 AM, John Baldwin <jhb@FreeBSD.org> wrote:
> >
>
(trimming a little)

> > One option is to always load the driver using an entry in loader.conf o=
r
> in
> > the kld_list variable in /etc/rc.conf.  Another option to do on-demand
> loading
> > is to write a custom devd handler.  You can find some examples in
> > /etc/devd/usb.conf (note that that file is auto-generated).  I'm not
> sure what
> > is output for a nomatch entry for an fdt bus.  For devices that appear =
at
> > runtime you can run 'cat /var/run/devd.pipe' in a window to see event
> details
> > to use to write your match rule.  However, for boot time events I think
> you
> > will need to resort to looking at the code to decipher what variables a=
re
> > passed that you want to match on.
>
> devinfo -v will tell you the pnp info, which is what you=E2=80=99ll need =
to match
> the
> device. This will load the driver after boot. It=E2=80=99s almost always =
easier,
> however,
> to just add the driver to your /boot/loader.conf file.
>
> Sometime before BSDcan this year, there will be the option to
> automatically load
> drivers based on PNP information from the parent bus coupled with the
> tables
> compiled into the .ko files, but that=E2=80=99s not possible today.

Warner
>
> Hello. Thank you and sorry for the delay.

I tried using the kld_list variable of /etc/rc.conf and it worked just
fine: my driver gets loaded on boot time.

On the other hand I couldn't get the loader.conf alternative to work: I
created a loader.conf file in /boot (since there wasn't one) with only one
line in it:

myDriver_load=3D"YES"

The driver is not loaded after boot and dmesg doesn't shows any message
about my driver.

I suspect that loader doesn't reads my file, because I also tried to change
the autoboot delay of loader by overriding on my file, the autoboot_delay
variable that's defined in /boot/defaults/loader.conf :

# cat /boot/loader.conf
loader_delay=3D"1"
autoboot_delay=3D"1"
myDriver_load=3D"YES"

But loader still waits 10 seconds before booting:
...
-
/boot/kernel/kernel data=3D0x4b3fc8+0x2c038 syms=3D[0x4+0x78c40+0x4+0x4b17f=
]
Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel] in 9 seconds ...
...


Do you think that loader is reading my file or not? If there is more
information that I can provide, just tell me!

Regards,
Matias.-



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLKG00AuNk5ky35j7Z%2BUxk%2BGyrRPsxRSf850QPH6tU68-U0Zw>