From owner-freebsd-current@FreeBSD.ORG Mon Mar 3 06:12:40 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27330106566C for ; Mon, 3 Mar 2008 06:12:40 +0000 (UTC) (envelope-from peter@wemm.org) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.248]) by mx1.freebsd.org (Postfix) with ESMTP id E0A9B8FC18 for ; Mon, 3 Mar 2008 06:12:39 +0000 (UTC) (envelope-from peter@wemm.org) Received: by an-out-0708.google.com with SMTP id c14so1408896anc.13 for ; Sun, 02 Mar 2008 22:12:39 -0800 (PST) Received: by 10.100.11.7 with SMTP id 7mr28540131ank.99.1204523263248; Sun, 02 Mar 2008 21:47:43 -0800 (PST) Received: by 10.100.8.6 with HTTP; Sun, 2 Mar 2008 21:47:43 -0800 (PST) Message-ID: Date: Sun, 2 Mar 2008 21:47:43 -0800 From: "Peter Wemm" To: "Bill Moran" In-Reply-To: <20080226133007.87340fd2.wmoran@potentialtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200802251858.05767.peter.schuller@infidyne.com> <20080226133007.87340fd2.wmoran@potentialtech.com> Cc: freebsd-current@freebsd.org, Peter Schuller Subject: Re: Recommended virtualization technique for debugging/developing FreeBSD X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2008 06:12:40 -0000 On Tue, Feb 26, 2008 at 10:30 AM, Bill Moran wrote: > In response to Peter Schuller : > > > > Hello, > > > > I was wondering what people use, in the abscense of suitable actual hardware, > > to debug/develop FreeBSD (the kernel in particular). I'm willing to resort to > > almost any host, including Windows, as long as I have something reliable. > > > > I haven't had much luck with qemu (crashes), nor virtualbox (crashes). I was > > going to go for vmware on Windows, but while it ran FreeBSD pretty well, > > before I had even percolated the disk layout enough to trigger the bug > > (required root-on-zfs) I was hoping to trigger, the vmware configuration tool > > crapped out on me and produced a configuration it could not itself read. > > > > What do all you regular kernel developers use, if not physical hardware? > > I know that bochs was used during some of the initial development of > the amd64 port, because bochs can emulate amd64 on i386 hardware. > > You're not going to see anything like impressive performance with bochs, > but it will allow you to see _everything_ the kernel is doing, i.e., you > can track each CPU instruction if you so desire. For what its worth, I never used an emulator, nor even gdb, for bringing up FreeBSD/amd64 to multi-user. It was all done with printf and a machine that booted up very very fast. It was at loader prompt in about 4 seconds from a power cycle. The initial kernels were netbooted with pxe and later disk booted on the machine that was set up for dual booting. Not long after it made it to multi-user, things like libc etc were all statically linked and everything was seld compiled but with an external compiler. I added most of the missing bits incrementally. David made the toolchain in the tree work and eventually it self-compiled using the in-tree compiler and toolchain. Most initial debugging was done with a super-low-level serial console, things like writing values to screen ram, 'hlt' intruction debugging to diagnose insta-reboots, etc. The initial address space size was 1GB. 512M for user, 512M for kernel. later came 4GB using i386's PAE strategies, then 512GB, then 128TB as I earned how to make pmap work. It was a lot of fun, but I had no real debugging capabilities. I thought about bochs but never used it. gdb wasn't available either. I've never used serial gdb. IA64 was different. Doug Rabson used things like emulators/simulators like Simics extensively, which had remote debugger (gdb?) hooks and the like. John Baldwin has been using qemu lately for bios/btx/loader work on x86. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell