From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 5 20:58:19 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A58B16A404 for ; Mon, 5 Mar 2007 20:58:19 +0000 (UTC) (envelope-from cynical.nihilist@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242]) by mx1.freebsd.org (Postfix) with ESMTP id 54DC013C428 for ; Mon, 5 Mar 2007 20:58:19 +0000 (UTC) (envelope-from cynical.nihilist@gmail.com) Received: by an-out-0708.google.com with SMTP id c24so1451303ana for ; Mon, 05 Mar 2007 12:58:18 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=tiyscxG6aZLRBEhqjQrthoglBL+XvIFH6dhDhLJoP+9useRLEYVhAAdH62BdVg2oPbj1H7pQQ4GRpTlYArPZyfWi05QkdLPahKyZDoajd5HD6JV+jKfPnBLJVdvJypoT5Q2YVbpUbRpvMewBBMkm6mxTwe2+r0ezXIX7wYOghYU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=aHFtGRBQ9uVgiVx4y/0WRc0sQ4JO9u9Wa9nbYp4oa79XbmJqmKtxqcT/SAE4MKu772juGW9M7SSn+527S4vqFF3QL4HOvN5jDHOTrhtN2qGsTaZ3zNrnVXw55fJH46waGWWA3JTIL4b6v2TGlsnE/mjGtEY563NHBW7PGpetqtk= Received: by 10.100.107.2 with SMTP id f2mr2890429anc.1173126670014; Mon, 05 Mar 2007 12:31:10 -0800 (PST) Received: by 10.100.124.20 with HTTP; Mon, 5 Mar 2007 12:31:09 -0800 (PST) Message-ID: <2f029c1c0703051231k7bc917d3ybb4bd236a242e6c1@mail.gmail.com> Date: Mon, 5 Mar 2007 15:31:09 -0500 From: "Dave Arsenault" To: freebsd-hackers@freebsd.org In-Reply-To: <20070303102954.GE9421@turion.vk2pj.dyndns.org> MIME-Version: 1.0 References: <20070303102954.GE9421@turion.vk2pj.dyndns.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: How should i start working on kernel programming? 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: Mon, 05 Mar 2007 20:58:19 -0000 How would I go about debugging a LKM. I am currently working on a simple kernel module that overwrites the open() syscall and sends the output through a parsing routine. I've read many articles talking about using the (gdb) add-symbol-file lkm.ko
and in fact that works but as far as I know I can set breakpoints that never break and that's pretty much it. Thanks On 3/3/07, Peter Jeremy wrote: > > On 2007-Mar-03 10:21:27 +0530, ajay gopalakrishnan > wrote: > >I am new to FreeBSD and I would like to know how to start off with kernel > >level programming. > > Apart from the links Sam gave you, I'd suggest you look at "The Design > and Implementation of the FreeBSD Operating System" by Kirk McKusick > and George Neville-Neil. > > As a general introduction, you might like to look through "The Complete > FreeBSD" by Greg Lehey (http://www.lemis.com/grog/Documentation/CFBSD/). > > > Also, the header packages used at the system level code and > >kernel level code were different. > > Yes. The internal kernel interfaces are defined in the section 9 man > pages. > > -- > Peter Jeremy > >