From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 6 12:51:23 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2611A16A4CE for ; Sun, 6 Feb 2005 12:51:23 +0000 (GMT) Received: from cyrus.watson.org (cyrus.watson.org [204.156.12.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id E38CE43D31 for ; Sun, 6 Feb 2005 12:51:22 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by cyrus.watson.org (Postfix) with SMTP id 14C6E46B16; Sun, 6 Feb 2005 07:51:22 -0500 (EST) Date: Sun, 6 Feb 2005 12:50:26 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Yan Yu In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: falloc() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2005 12:51:23 -0000 On Sat, 5 Feb 2005, Yan Yu wrote: > I am wondering if there is a way to use kernel loadable module to > replace the original falloc() (kern/kern_descrip.c) in the system. I > know how to do this if the funciton to be replaced is some system call > function or ufs* operatio ( i could just change the symbol table which > holds these function pointers),. but i could not find the symbol table > which holds the falloc() function pointer... falloc() isn't considered a "pluggable" kernel API, that is to say, we've not engineered FreeBSD with the intent that it be replaced at run-time. As such, to get falloc() replaced on your out-of-the-box FreeBSD install, you'll need to modify the kernel linking. falloc is non-static, so it should be an exported symbol from kern_descrip.o and in theory exposed to modules -- however, replugging the current reference in kern_descript.o might be the hard one to modify. If you don't mind my asking, what motivates you to replace falloc()? Robert N M Watson