From owner-freebsd-fs@FreeBSD.ORG Mon Jul 24 19:50:45 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33D2C16A4DA for ; Mon, 24 Jul 2006 19:50:45 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EBA443D66 for ; Mon, 24 Jul 2006 19:50:43 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k6OJohSH044611; Mon, 24 Jul 2006 14:50:43 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44C5249E.4010603@centtech.com> Date: Mon, 24 Jul 2006 14:50:54 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.4 (X11/20060612) MIME-Version: 1.0 To: Shane Adams References: <20060724194208.55037.qmail@web31804.mail.mud.yahoo.com> In-Reply-To: <20060724194208.55037.qmail@web31804.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1616/Mon Jul 24 12:49:29 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: freebsd-fs@freebsd.org Subject: Re: Advice for hacking on ufs/ffs X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2006 19:50:45 -0000 On 07/24/06 14:42, Shane Adams wrote: > Quick question - how do you install to a disk image? > > I'm still at work. I myself use mdconfig to create a file backed device that I use to mount and experiment with. I just newfs on that device and away I go. > > I was thinking of getting the small 20mb boot image and using that as a base. Just need some clarification on how to install my module on top of that. > > Cheers, > Shane I use mdconfig and then do an installworld with DESTDIR and such set. man build should help with that I think. I also sent you my personal cheat sheet on this if that helps. Eric > ----- Original Message ---- > From: Eric Anderson > To: Shane Adams > Cc: freebsd-fs@freebsd.org > Sent: Monday, July 24, 2006 12:06:47 PM > Subject: Re: Advice for hacking on ufs/ffs > > On 07/24/06 13:52, Shane Adams wrote: >> Hello, >> >> I'm a programmer that is new to kernel development. I'm interested in hacking around on UFS and FFS. I only have one machine so I copied the complete sys/ufs code to a new directory under fs, and changed a few things to get it to compile and mount. Everything works, and I was ready to start hacking without worrying so much about screwing up my system. >> >> Naturally I've rebooted the machine a few times since then, and I was wondering if anyone has advice for a fledgling kernel programmer. (Best practices) >> >> I read someplace that the UFS (some revision of the code) was written in userland then ported to the kernel. Is that how McKusick implemented softupdates or snapshots? The code is so dense I have trouble fathoming writing that much code in the mannor in which I've been tackling it. >> >> When I make a mistake, the machine freeze's, then reboots. I don't seem to get a kernel dump (or I'm not looking in the right location). >> >> Anway, kind of a broad question I know, just looking for a few tips! >> >> Cheers, >> Shane > > > Hi Shane! I'm in the same situation, and what I've done, is have a > local copy of the cvs repo, then I check out (and/or update) a working > copy into a separate directory, work on it, make changes, etc. Then I > build (or build world, or whatever I need), and install to a mdconfig'ed > disk image. Then, I boot qemu using that image, and run my tests, do > debugging from the debugger, etc. I also nfs mount (using tap devices) > the /usr/src in qemu from my separate checked out src tree on my local > machine, so I can boot the qemu machine, and do buildworlds inside it > (although it's slower). > > This seem to work very well for me, and I do all my development on my > laptop while on-the-go. I too am tinkering with filesystems. > > Eric > > -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------