From owner-cvs-all Wed Apr 26 11:38:28 2000 Delivered-To: cvs-all@freebsd.org Received: from assaris.sics.se (assaris.sics.se [193.10.66.234]) by hub.freebsd.org (Postfix) with ESMTP id AB12B37B775 for ; Wed, 26 Apr 2000 11:38:24 -0700 (PDT) (envelope-from assar@assaris.sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id UAA77001; Wed, 26 Apr 2000 20:36:31 +0200 (CEST) (envelope-from assar) To: Greg Lehey 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) References: From: Assar Westerlund Date: 26 Apr 2000 20:36:30 +0200 In-Reply-To: owner-cvs-all-digest@FreeBSD.ORG's message of "Tue, 25 Apr 2000 20:19:07 -0700 (PDT)" Message-ID: <5lu2gog15d.fsf@assaris.sics.se> Lines: 35 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Date: Wed, 26 Apr 2000 10:25:22 +0930 > From: Greg Lehey > 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