Skip site navigation (1)Skip section navigation (2)
Date:      14 Jan 1999 02:15:31 +0100
From:      Assar Westerlund <assar@sics.se>
To:        current@FreeBSD.ORG
Subject:   issues with building KLDs: dynamic numbers and compilation options
Message-ID:  <5l3e5eodsc.fsf@assaris.sics.se>

next in thread | raw e-mail | index | archive | help
Hi

I've found some issues with the current way of building KLDs (and LKMs
actually as well) while building the kernel module for Arla
<http://www.stacken.kth.se/projekt/arla>, that I'll try to summarize
here and give me thoughts on the ways of solving them.

1. It's hard to figure what dynamic numbers (syscall numbers and cdev
numbers) your module got assigned and to do something with them.  I
believe this could be solved with kern/9359 (already closed) and
kern/9478 (not yet applied :-).

2. The module has to be compiled with same options as the kernel
already has been compiled with and there's no way of finding out what
those were.  The problem is here mainly with DIAGNOSTIC (and
INVARIANTS).  If you don't build your module with or without
-DDIAGNOSTIC in the same way as the kernel, your loose.  The most
noticable case is `zfree'.

There are of course several options for fixing this:

a. Install opt_global.h when installing the kernel
b. Make the functions that depend on DIAGNOSTIC and INVARIANTS
non-inline.
c. Add non-inline versions of the above mentioned functions for
modules.

I would prefer b) or c) (that would allow using the same KLD module
for differently compiled kernels) and would be willing to write the
necessary patches.

/assar

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5l3e5eodsc.fsf>