Subject: Re: GENERIC is absurdly big
To: J. Buck Caldwell <netbsd2@bitparts.org>
From: Quentin Garnier <netbsd-port-i386@quatriemek.com>
List: port-i386
Date: 12/21/2003 06:01:42
Le Sat, 20 Dec 2003 17:36:36 -0600
J. Buck Caldwell a ecrit :
> So I'm not a kernel programmer, so I may be speaking completely out of 
> my ass here, but would it be possible to to strip all of the 
> netcard/soundcard/USB/whathaveyou drivers out of the kernel and turn 
> them into LKMs? Granted, you'd still want bus and scsi drivers (for boot
> support) in the kernel itself, but what about anything that's not 
> required to boot? Perhaps you could even put IPSEC, PPP, and various net
> (anet, pty, gre, etc) stuff in LKMs?
> 
> Excuse me if I've just made it painfully obvious that I don't know what 
> LKMs are used for. Like I said, I'm not a kernel programmer, just making
> educated guesses.

There's about nothing in the kernel right now to:

1. Make it easy to write device drivers LKMs
2. Allow compilation of in-tree drivers as LKMs

That said, I have here a set of audio drivers LKMs.  I'm also working (as
in "pet project for train journeys") on config(8) hacks to allow
modularisation directly from the kernel config file ("I want this as a
module", and then config says yes or no about it, depending on other
things).

I'm mostly done for config(8), but the next step will be an in-kernel
linker to make it easy to load LKMs which use precise resources of the
kernel, and to manage dependencies between them.  (There's no dependency
information in our current LKM scheme.  Beware of unloading them in the
right order!)

Thus, the answer to your question is no.

-- 
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"Feels like I'm fiddling while Rome is burning down.
Should I lay my fiddle down and take a rifle from the ground ?"
Leigh Nash/Sixpence None The Richer, Paralyzed, Divine Discontents, 2002.