From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 10:09:25 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DD01106568C for ; Sun, 16 Nov 2008 10:09:25 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (unknown [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 18EC78FC2C for ; Sun, 16 Nov 2008 10:09:24 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id BAFF51CD2C; Sun, 16 Nov 2008 11:09:23 +0100 (CET) Date: Sun, 16 Nov 2008 11:09:23 +0100 From: Ed Schouten To: Alexej Sokolov Message-ID: <20081116100923.GU81783@hoeg.nl> References: <671bb5fc0811151927j6dcb5155oeffbf4cc95cbccb6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DvifzEOEABd5jzbd" Content-Disposition: inline In-Reply-To: <671bb5fc0811151927j6dcb5155oeffbf4cc95cbccb6@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: FreeBSD Hackers Subject: Re: KLD loading, liking X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2008 10:09:25 -0000 --DvifzEOEABd5jzbd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Alexej Sokolov wrote: > sysinit_set -contain a structure with a pointer to function which will be > called by loading of KLD When you place SYSINIT() lines in your code, you can request functions to be called when the code is loaded. There are also some macro's such as MTX_SYSINIT(), which is a friendly wrapper around SYSINIT() which initialises a mutex. > modmetadata_set - what kind of information is there and which functions of > linking/loading use it ? Each loadable kernel module contains a structure that contains the module name, but also a function pointer to the routine that contains the module's load/unload function. If this function returns an error, the kernel module will not be (un)loaded. Take a look at the simple kernel modules such as snp(4). > What exact does the macro MODULE_DEPEND ? The man page is to short, and I > guess it tell no all things that the macro does. MODULE_DEPEND is used to say: this kernel module also depends on another module (i.e. the USB printer module depends on the USB code). Tools like kldload can then automatically load the missing modules. --=20 Ed Schouten WWW: http://80386.nl/ --DvifzEOEABd5jzbd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkf8VMACgkQ52SDGA2eCwXCigCfbiphKlXh5vTMpycMsCvcAcnV 5g4AmQE8/fRTTrn653eOOb4PZH1P+aKC =wvvJ -----END PGP SIGNATURE----- --DvifzEOEABd5jzbd--