From owner-freebsd-chat Fri Mar 7 11:29:15 2003 Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F079737B401 for ; Fri, 7 Mar 2003 11:29:13 -0800 (PST) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6373F43F75 for ; Fri, 7 Mar 2003 11:29:13 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from dialup-209.244.106.70.dial1.sanjose1.level3.net ([209.244.106.70] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18rNWl-0000sp-00; Fri, 07 Mar 2003 11:29:07 -0800 Message-ID: <3E68F2B2.43FB7053@mindspring.com> Date: Fri, 07 Mar 2003 11:27:46 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Damien Tougas Cc: freebsd-chat@freebsd.org Subject: Re: A question about kernel modules References: <200303071134.27979.damien@tougas.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a460c48d44cf3abd00545302e775b8f320350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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. Code in the boot path which must operate before the kernel is fully up can not be handled as modules. In general, drivers which require large contiguous chunks of physical memory (e.g. video capture cards) must obtain their memory before much has been done, since physical memory fragments quickly under the influence of aggressive page caching, etc.. Some interfaces do not have the indirect references necessary to allow modules which attach to them to be dynamically loaded (e.g. networking stacks in general, or the TCP and IP protocol boundary, as a specific example). > Why does FreeBSD not do this by default for the GENERIC kernel? The GENERIC kernel is loaded from a CDROM controller BIOS faked-up floppy drive, which is how CDROMs are able to boot. Even if all other issues were resolved, this floppy image would be unable to contain all the necessary modules. For the modules to be read off the CDROM or other boot media, all the code in the module loading path would have to be statically present (ISO9660 FS, ATA and SCSI drivers, CDROM driver, etc., etc.). By including all the drivers in the GENERIC kernel, it makes it much more likely that you will b able to actually install FreeBSD in the first place. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message