Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Feb 1999 16:24:33 -0800 (PST)
From:      Archie Cobbs <archie@whistle.com>
To:        assar@sics.se (Assar Westerlund)
Cc:        eivind@FreeBSD.ORG, freebsd-current@FreeBSD.ORG
Subject:   Re: panic: zone: entry not free
Message-ID:  <199903010024.QAA17791@bubba.whistle.com>
In-Reply-To: <5lemnaxj6c.fsf@mg.trafford.dementia.org> from Assar Westerlund at "Feb 28, 99 11:22:35 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Assar Westerlund writes:
> I think that the goal should be to make KLDs work with all kinds of
> kernels.  

I've been thinking about this too...

Certainly, for each kernel config option FOO we could have a symbol
in the kernel that a KLD could examine:

  static const u_char kernlel_option_FOO = 1;

But what to do about KLD's that want to link against kernel symbols
that may or may not exist? For example, some KLD's that present
interfaces would like to know if BPF is in the kernel, and if so
to support it .. but this means linking with bpfattach(), etc..

Would it be possible to permit 'partial' linking of a KLD, so that
the following code would work no matter what kernel was used?

  int
  xyz_attach()
  {
     ...
     if (kernlel_option_BPF > 0)
       bpf_attach(..);	/* "bpf_attach" only gets resolved if it exists
			 * in the kernel; otherwise, it remains NULL but
			 * that's OK because in that case we don't call it
			 */
     ...
  }

Maybe this would require something like this in the KLD..

  MODULE_BREAKABLE_LINKS(xyz) { "bpfattach", "bpf_mtap" };

A fair bit of hackery, but probably worth it...

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


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?199903010024.QAA17791>