Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Apr 2019 20:52:50 -0400
From:      Lee D <embaudarm@gmail.com>
To:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   What code loads kernel modules at boot?
Message-ID:  <CANC_bnNog192=sAgw6uu7J_oJMPLGyMa57y-eXNxHv_g-KMvOw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
A couple of years ago I wrote a FreeBSD bootloader for Zynq (Arm32).
It's been working well, but now I need to add the ability to load
kernel modules at boot.  This is for 11.0.1 (updating to 12 soon,
hopefully).

Can anyone point me to the code that actually loads a kernel module
for arm?  I got lost reading the source in /src/sys/boot/common, and
can't quite figure out what routine is actually called.

I assume I need to parse the sections out of the .ko file and place
them carefully in memory, like I do with the kernel image.

Also, if you're feeling loquacious, where do I put the darn thing and
how do I tell the kernel how to find it (part of the MODINFO stuff I
assume)?

This is all in the context of loading custom real time clock and I2C
drivers so they are available at boot time.

Thanks,

Lee



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANC_bnNog192=sAgw6uu7J_oJMPLGyMa57y-eXNxHv_g-KMvOw>