Monolithic vs Modular Kernel?

Matthew Seaman m.seaman at infracaninophile.co.uk
Thu Dec 10 09:12:44 UTC 2009


David Naylor wrote:
> Hi,
> 
> What are the pros and cons of building a stripped down kernel and loading all 
> the missing parts via modules (such that you end up with the same 
> functionality as generic kernel) vs having a kernel with all the modules built 
> in? 

Flexibility mainly.  The default kernel is pretty highly modularized nowadays,
meaning that it doesn't need to be enormous but can still support most hardware
encountered in the field.  Even so, it still contains some wired-in code to 
support certain classes of functionality that will not be necessary on all 
systems.  

In general, there's not a huge benefit compared to the inconvenience to be gained 
from aggressively stripping down your kernel nowadays, unless you have a 
particular need for a really minimal system.

> Also, is there anyway to detect if there are hardware without drivers (such as 
> a sound card without any snd_ loaded) and to detect the type of device (e.g. 
> network, usb, sound, graphics)?

Running:

   # pciconf -lv

will show up any devices on the PCI busses without any attached drivers.
Similarly usbconfig(8) will tell you all about attached USB busses and devices.

> Lastly, is there any way to determine what 'modules' a kernel is build with?

Examine the kernel configuration file.  If you don't have access to this, you
might be able to extract it from the kernel image if it has been built with

   options         INCLUDE_CONFIG_FILE

however, AFAIK this isn't the default for GENERIC kernels. 

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       Flat 3
                                                      7 Priory Courtyard
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
                                                      Kent, CT11 9PW, UK

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20091210/ddc27eda/signature.pgp


More information about the freebsd-questions mailing list