I have designed a ksyms driver for -current, it is attached to this mail.

I would like some feedback on the specific design of this driver and also
if other people in the FreeBSD camp would find it useful, several other
systems implement some like functionality and I see no reason why we
cannot.

One of the design goals was to be able to tell what symbols were provided
by what kernel modules.  This was fairly easy to do by making each kernel
module have its own ELF symbol table, therein lies is the problem.  Some
programs (readelf) dont mind multiple symbol tables, others (nm) do.

One solution I have come up with but have not designed follows:

Create a specific /dev/ksyms/xxx entry for each kernel module that
is loaded in addition to an 'all' entry.  The 'all' entry would have some
different logic so that it only creates one symbol table based upon the
symbols from all modules.  The entries in the directory would be updated
whenever modules were loaded or unloaded.

This solution seems to be the most robust one to me but it also means that
the driver would have to rely on devfs to function correctly.

Thoughts?

Attachment: ksyms.tgz
Description: application/tar-gz

Reply via email to