On Wed, Jul 28, 2004 at 11:44:58AM -0300, Cleyton Agapito wrote:

>     Sorry if this sound stupid, but i can?t understand yet how FBSD work
> with
> modules. The Handbook is not so clear about what you must compile
> statically in
> kernel (like so difference between make and buildkernel procedures), i
> suppose
> that if you don?t use a feature every time it will be a module (right?),
> but i?m a
> little disapointed because i must load in loader.conf and they stay
> there all the time
> or else i can?t find the device on /dev (like fdc.ko), i thought to
> unload all unused with
>  kldunload but it must be done one by one.
>     I have many others questions bsd-related  like that but maybe this
> is not the right place, the
> FAQs are not enough to learn system and others hacker-like are so
> difficult! Where can I find
> a median list to ask commons operational questions?
>     I wonder with FBSD, it?s not so easy like linux but is very much
> better (my opinion) :-)

No -- it's not a stupid question at all.  Some drivers have to be
compiled into the kernel, others may either be compiled in or loaded
as modules and there are a few proprietary drivers /only/ available as
modules (the nVidia graphics driver is a good example of the latter).

Some of those modules must be loaded early in the boot process --
hence you need to make an entry in loader.conf to get them loaded
before the kernel really starts to boot.  Others the kernel will load
as it probes the hardware, and finds devices it needs to drive.  Yet
others can be loaded later on, even after the system has completely
booted up -- in fact where this is the case you'll often find that the
module will be loaded automatically for you.

And just to be more confusing, the capabilities of the various drivers
are being refined and extended over time, so a module in 4.x which has
to be compiled in might be dynamically loadable in 5.x.

Usually there will be a man page for each driver in section 4 of the
manual -- eg. fdc(4) is the driver for the floppy disk controller.
That, or one of the pages referenced from it, should explain how
devices can be loaded: generally if it doesn't say anything along
those lines, the driver may well be compiled-in only, but there's no
surefire way of telling.  Of course, if you are familiar with the
system sources, you can just look at the source code for each driver
and tell pretty quickly in what ways it can be used.

The usual strategies with FreeBSD are either:

    1) create your own custom kernel image, where you include the
       drivers you have hardware for, and exclude the rest.  In this
       case, you wouldn't generally use loadable modules at all.

    2) run using the GENERIC kernel, which has support for most common
       devices, and can load modules to support anything else you're
       likely to encounter.

I've never heard of anyone trying to make a 'maximally dynamically
loaded' kernel.  Might be an interesting thing to try at some point.



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgpeTzPqsIO2s.pgp
Description: PGP signature

Reply via email to