From owner-cvs-all Tue Dec 22 21:36:57 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA29730 for cvs-all-outgoing; Tue, 22 Dec 1998 21:36:57 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA29720; Tue, 22 Dec 1998 21:36:52 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id QAA06300; Wed, 23 Dec 1998 16:06:21 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id QAA12529; Wed, 23 Dec 1998 16:06:21 +1030 (CST) Message-ID: <19981223160621.D12346@freebie.lemis.com> Date: Wed, 23 Dec 1998 16:06:21 +1030 From: Greg Lehey To: Peter Wemm Cc: Bruce Evans , jonny@jonny.eng.br, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG Subject: Re: Use of LKMs (was: cvs commit: src/share/mk bsd.kern.mk src/sys/alpha/conf Makefile.alpha) References: <19981220101713.O24125@freebie.lemis.com> <199812230532.NAA39231@spinner.netplex.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199812230532.NAA39231@spinner.netplex.com.au>; from Peter Wemm on Wed, Dec 23, 1998 at 01:32:50PM +0800 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk On Wednesday, 23 December 1998 at 13:32:50 +0800, Peter Wemm wrote: > Greg Lehey wrote: >> On Saturday, 19 December 1998 at 23:27:39 +1100, Bruce Evans wrote: >>>> #define quoting(Bruce Evans) >>>> // src/lkm -> src/sys/lkm (like src/sys/modules) >>>> >>>> Is there a reason to keep the lkm's, now that kld's are working ? >>>> (Aren't they ?) >>> >>> They might still be being used. >> >> [Somehow I missed the original of this] >> >> What's the current situation for kld debugging? I'm using Vinum as an >> lkm because I can debug it that way. > > It works just fine, with one exception.. With LKM's you use a fixed > offset to skip the header - 0x20 from memory. With KLD's you have to get > that from the header: > # objdump --headers /modules/vinum.ko | more > Idx Name Size VMA LMA File off Algn > [..] > 6 .text 0000915c 000051e4 000051e4 000051e4 2**2 > CONTENTS, ALLOC, LOAD, READONLY, CODE > In this case, it would be 0x51e4 as the symbol offset rather than 0x20. > > Scriptifying that could be fun though.. :-/ Remember that the value must be stored in kernel memory somewhere, and gdb has access to it. All I need to know is the location. What concerns me more is that when testing an LKM, I simplify things by having only one LKM loaded, so it's always in lkmods[0]. It looks like it would be difficult to achieve this with klds. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message