From owner-freebsd-questions@FreeBSD.ORG Wed Jan 9 11:44:56 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 273FE5A1 for ; Wed, 9 Jan 2013 11:44:56 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id DBD517DE for ; Wed, 9 Jan 2013 11:44:55 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Tsu5l-0003dt-Iw for freebsd-questions@freebsd.org; Wed, 09 Jan 2013 12:45:09 +0100 Received: from pool-173-79-84-117.washdc.fios.verizon.net ([173.79.84.117]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Jan 2013 12:45:09 +0100 Received: from nightrecon by pool-173-79-84-117.washdc.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Jan 2013 12:45:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Michael Powell Subject: Re: installing a new device driver Date: Wed, 09 Jan 2013 06:44:42 -0500 Lines: 53 Message-ID: References: <1357726153.65344.YahooMailNeo@web160101.mail.bf1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pool-173-79-84-117.washdc.fios.verizon.net X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: nightrecon@hotmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 11:44:56 -0000 Jack Mc Lauren wrote: > Hi all > Sorry I ask so much cause I'm a new user to freeBSD :) > > Hear's the deal. How can I install a new device driver on my OS ? Please > explain in details because of the reason I mentioned earlier :) > First, please understand that FreeBSD is a mostly, self-contained operating system. Generally speaking the difference is in where the driver itself comes from. There are exceptions, as there are indeed some vendors who provide driver code to the project as third-party add ins, but much driver code is written by and contained within the project itself. This means that you will not go willy-nilly surfing all over the web downloading drivers to install. If you have the source code for the OS installed (it was an option during install) you might want to look at a kernel configuration file for a basic idea on how drivers 'relate' in FreeBSD. On an i386 system there will be a path /usr/src/sys/i386/conf/, and on a 64 bit install the kernel config file will be located under /usr/src/sys/amd64/conf. On a brand new machine with no custom kernel you will see a file under these location(s) called simply GENERIC. This is the kernel configuration file for the OS as distributed and until one generates and compiles their own custom kernel it will be what you are running. Notice lines within the file that begin with 'options' and 'device'. The lines you see that start with 'device' are device driver(s) that are built into the kernel itself. There is such a wide variety in the GERNERIC kernel because it ships as designed to be ready to operate on a plethora of differenet hardware. Many people will build a custom kernel that strips out all of these that they do not need. So what if you strip out something that you do need does that mean that you have to build a new kernel all over again? Quite possibly not, as FreeBSD also has something called 'kernel modules' as well. If you look in /boot/kernel you will notice a lot of files that end in a ".so" extension. These are kernel modules (think 'drivers' here - it is pretty much the same idea). You can load and unload these kernel modules while a system is running using kldload and kldunload commands. The command kldstat will inform you about ones that are loaded and active. The thing you need to know is you can't kldload a kernel module if that corresponding function is already built-in and present in the running kernel. Example: a kernel config file with 'device em' means the driver is already compiled into the kernel and you will receive an error should you attempt to kldload the if_em.ko kernel module. Just to expand a little for some quick grokage.... :-) -Mike