Skip site navigation (1)Skip section navigation (2)
Date:      26 Apr 2000 20:36:30 +0200
From:      Assar Westerlund <assar@sics.se>
To:        Greg Lehey <grog@lemis.com>
Cc:        cvs-all@FreeBSD.ORG
Subject:   Re: How about building modules along with the kernel? (was: cvs commit: src/sys/modules/syscons/fire fire_saver.c src/sys/modules/syscons/rain rain_saver.c src/sys/modules/syscons/warp warp_saver.c)
Message-ID:  <5lu2gog15d.fsf@assaris.sics.se>
In-Reply-To: owner-cvs-all-digest@FreeBSD.ORG's message of "Tue, 25 Apr 2000 20:19:07 -0700 (PDT)"
References:  <bulk.27680.20000425201907@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> Date: Wed, 26 Apr 2000 10:25:22 +0930
> From: Greg Lehey <grog@lemis.com>
> Subject: Re: How about building modules along with the kernel? (was: cvs commit: src/sys/modules/syscons/fire fire_saver.c src/sys/modules/syscons/rain rain_saver.c src/sys/modules/syscons/warp warp_saver.c)
>
> Maybe we should do something like this:
> 
> 1.  Decide which data structures modules are allowed to access (and be
>     generous).

Please don't.  You'll never be generous enough. :-)  Seriously
speaking, there are already enough gotchas when building modules
against FreeBSD kernels (extern inline functions, functions that
expand to different code with DIAGNOSTIC/DEBUG, ...) to make it
harder.

Linux does this with functions and it's a pain.

> 2.  Maintain a data structure generation number.  Every time one of
>     the designated data structures changes, bump the number.  Store
>     the number both in the kernel and in each module.

Yes, but I think this is more complicated than necessary.  When
structures start depending on each other, depending on how they work
and such.  

Just keep one version number and bump it whenever something change.
NetBSD does this in their -current branch and it works reasonably well.

> 3.  When loading modules, compare the numbers.  Refuse to load if
>     they're different.  This would also solve the "inexplicable"
>     crashes people sometimes see.

Right.

/assar


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




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