Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Mar 2003 01:07:37 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Bill Moran <wmoran@potentialtech.com>
Cc:        Damien Tougas <damien@tougas.net>, freebsd-questions@FreeBSD.ORG
Subject:   Re: A question about kernel modules
Message-ID:  <20030307230737.GD8357@gothmog.gr>
In-Reply-To: <3E68FBD4.2090401@potentialtech.com>
References:  <200303071155.43785.damien@tougas.net> <3E68FBD4.2090401@potentialtech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2003-03-07 15:06, Bill Moran <wmoran@potentialtech.com> wrote:
>Damien Tougas wrote:
>>Is there any advantage/disadvantage to using kernel moduls
>>vs. staticly linking stuff in the kernel? I would like to eliminate
>>everything from my kernel config that can be loaded as a module,
>>then load them at boot using loader.conf. Is there any reason I
>>would not want to do that? It seems to me that it would make things
>>much easier.
>
> I would guess there are a number of reasons ...  First would be
> historical.  BSD is historically a monolithic kernel.  The more you
> rely on modules, the more the kernel acts like a microkernel.  I
> suspect that some day, FreeBSD will be a microkernel, but I don't
> expect that to be for many, many releases.  The change involves a
> lot.  For now, though, FreeBSD is still a monolithic kernel, and
> people treat it that way even when need does not require it.  The
> other reason I've heard is that KLDs don't run as fast and use more
> memory than the same functionality compiled into the kernel.  I've
> never tested this, but I'm guessing that the difference is
> negligible on modern hardware.
>
>> Why does FreeBSD not do this by default for the GENERIC kernel?
>
> Not sure.

The GENERIC kernel needs to support release CD-ROMs.  Looking at the
logs of GENERIC since day 1, it sems that there are various reasons
for putting things "in" GENERIC and not in modules.

a) Some things are put into GENERIC because it's hard to make them
   work as modules.

	INET, device ether, etc.

b) Other things are absolutely necessary to be able to boot into the
   installation program.

	FFS support, MD_ROOT, NFSCLIENT and NFS_ROOT, atapi, scsi and
	usb device drivers (imagine the frustration of trying to
	install with a USB keyboard, but without USB support).

If I'm wrong, I'm sure someone with better knowledge of the kernel
internals will correct me[?].

Bearing this in mind, in 5.X there is now a third floppy disk when
installing from floppies.  The 'drivers' floppy contains a lot of
drivers as modules... so, some effort is being done to modularise
things as much as possible :-)

- Giorgos


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030307230737.GD8357>