[Gllug] Module vs compiled in...

Phil Reynolds phil at tinsleyviaduct.com
Fri Jul 18 19:52:59 UTC 2003


On Fri, Jul 18, 2003 at 08:45:22PM +0100, Martin A. Brooks wrote:
> At 19:51 18/07/2003, you wrote:
> >As far as I can tell, the only reason to build something as a module is
> >because you haven't bought the device in question yet.
> 
> Wrong. Take USB devices and other hot-pluggable devices, you _want_ the 
> drivers to dynamically load and unload, otherwise hotplugging would only 
> ever work for the first device inserted, and it would have to be inserted 
> before the kernel booted.

Module or compile in... always a big debate. One advantage of modules:
they can (at least in theory) be automatically unloaded when idle and
they can also be loaded automatically when needed, which in turn means
that they are not taking up memory when they are not needed... and the
kernel, with all compiled-in support for things, has to remain in memory
at all times and cannot be swapped out. So, keeping the kernel small and
using modules helps that.

Further, Martin's point about hot-pluggable devices is correct.

I always compile my kernel with the minimum possible compiled in and
as much as possible done with modules. In general, if something can be
done as a module, the only reason to compile it in would be if it is
essential to the running of your system before the point where module
loading becomes possible. For example, you must include a binary format
(ELF recommended but a.out OK too), support for disk controllers, disks
and file systems needed to get your system up, but in general,
everything else that can be compiled as a module, I do. Understanding
the modutils package can help you troubleshoot, as well as handle
unusual requirements.

Some people like to make their kernel as monolithic as possible... often
easier, but if complex options are required, it can be messy.

-- 
Phil Reynolds (new PGP key as of 01/05/2003)
 o  ____ mail: phil at tinsleyviaduct.com
|L_ \  / Web: http://www.tinsleyviaduct.com/phil/
(_)- \/  Waltham 67, Emley Moor 69, Droitwich 79, Windows 95

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list