From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 8 17:42:47 2007 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 54F8016A468 for ; Wed, 8 Aug 2007 17:42:47 +0000 (UTC) (envelope-from cb@severious.net) Received: from ion.gank.org (ion.gank.org [69.55.238.164]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE4213C483 for ; Wed, 8 Aug 2007 17:42:47 +0000 (UTC) (envelope-from cb@severious.net) Received: by ion.gank.org (Postfix, from userid 1001) id A08B1117A8; Wed, 8 Aug 2007 12:25:38 -0500 (CDT) Date: Wed, 8 Aug 2007 12:25:36 -0500 From: Craig Boston To: Biks N Message-ID: <20070808172535.GA8404@nowhere> Mail-Followup-To: Craig Boston , Biks N , freebsd-hackers@freebsd.org References: <50cd4e5f0708080923p1d441e66ha6b42e277b55f8d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50cd4e5f0708080923p1d441e66ha6b42e277b55f8d@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-Mailman-Approved-At: Wed, 08 Aug 2007 18:26:18 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: Using userland library in Kernel 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: Wed, 08 Aug 2007 17:42:47 -0000 On Wed, Aug 08, 2007 at 11:23:25AM -0500, Biks N wrote: > I am new to FreeBSD kernel programming and I am trying to use userland > library (zlib) in FreeBSD kernel. But I am not sure if zlib library is > linkable from the kernel. Normally, no, you can't just link in a library designed for userland into the kernel. Some porting is required to deal with the kernel environment -- things such as not having a full C library available, different memory management, etc. In this case however, there is already a zlib implementation in the kernel. IIRC, geom_uzip and the crypto framework both use it. You may want to check out sys/net/zlib.[ch] and see if it can do what you're after. You'll need to make sure to include a dependency on the zlib module and/or add it to your kernel configuration. Good luck, Craig